From: Simon Marlow Date: Mon, 4 Apr 2011 07:52:00 +0000 (+0100) Subject: add notes about the non-thread-localness of the current directory (#4082) X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=commitdiff_plain;h=d84494e2bc50fd97d78681cbfa11961b7903b93c add notes about the non-thread-localness of the current directory (#4082) --- 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 ()