X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FDirectory.hs;fp=System%2FDirectory.hs;h=48bb364e773bb69127e294f79ea86d89f2102021;hb=bef2ea0ba09b702ec82b0384c812c15a86a9e0f5;hp=3455f4d3b6d5fa59d8ba56a3749167a015c0797b;hpb=7df5ce8c539a826a78249fa0688c05dd9f301214;p=haskell-directory.git diff --git a/System/Directory.hs b/System/Directory.hs index 3455f4d..48bb364 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -660,11 +660,24 @@ makeRelativeToCurrentDirectory x = do cur <- getCurrentDirectory return $ makeRelative cur x --- | Given an executable file name, searches for such file --- in the directories listed in system PATH. The returned value --- is the path to the found executable or Nothing if there isn't --- such executable. For example (findExecutable \"ghc\") --- gives you the path to GHC. +-- | Given an executable file name, searches for such file in the +-- directories listed in system PATH. The returned value is the path +-- to the found executable or Nothing if an executable with the given +-- name was not found. For example (findExecutable \"ghc\") gives you +-- the path to GHC. +-- +-- The path returned by 'findExecutable' corresponds to the +-- program that would be executed by 'System.Process.createProcess' +-- when passed the same string (as a RawCommand, not a ShellCommand). +-- +-- On Windows, 'findExecutable' calls the Win32 function 'SearchPath', +-- which may search other places before checking the directories in +-- @PATH@. Where it actually searches depends on registry settings, +-- but notably includes the directory containing the current +-- executable. See +-- for more +-- details. +-- findExecutable :: String -> IO (Maybe FilePath) findExecutable binary = #if defined(mingw32_HOST_OS)