[commit: directory] master: add notes about the non-thread-localness of the current directory (#4082) (d84494e)

Repository : ssh://darcs.haskell.org//srv/darcs/packages/directory On branch : master http://hackage.haskell.org/trac/ghc/changeset/d84494e2bc50fd97d78681cbfa1196...
---------------------------------------------------------------
commit d84494e2bc50fd97d78681cbfa11961b7903b93c
Author: Simon Marlow
---------------------------------------------------------------
System/Directory.hs | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/System/Directory.hs b/System/Directory.hs index d264583..6c28eef 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -862,6 +862,11 @@ Insufficient resources are available to perform the operation. * 'UnsupportedOperation' The operating system has no notion of current directory. +Note that in a concurrent program, the current directory is global +state shared between all threads of the process. When using +filesystem operations from multiple threads, it is therefore highly +recommended to use absolute rather than relative `FilePath`s. + -} #ifdef __GLASGOW_HASKELL__ getCurrentDirectory :: IO FilePath @@ -902,6 +907,11 @@ current directory cannot be dynamically changed. The path refers to an existing non-directory object. @[ENOTDIR]@ +Note that in a concurrent program, the current directory is global +state shared between all threads of the process. When using +filesystem operations from multiple threads, it is therefore highly +recommended to use absolute rather than relative `FilePath`s. + -} setCurrentDirectory :: FilePath -> IO ()
participants (1)
-
Simon Marlow