[commit: packages/process] master, wip/issue15: Move docs on semantics for raw commands from `proc` to `RawCommand` (6446907)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:37:01 UTC 2015


Repository : ssh://git@git.haskell.org/process

On branches: master,wip/issue15
Link       : http://ghc.haskell.org/trac/ghc/changeset/64469076c4ed520c9213267ed1eaf7317034b5b9/process

>---------------------------------------------------------------

commit 64469076c4ed520c9213267ed1eaf7317034b5b9
Author: Simon Hengel <sol at typeful.net>
Date:   Sat Nov 1 12:34:20 2014 +0800

    Move docs on semantics for raw commands from `proc` to `RawCommand`
    
    (This is where it belongs to, IMHO.)
    
    Closes #8


>---------------------------------------------------------------

64469076c4ed520c9213267ed1eaf7317034b5b9
 System/Process.hs           | 29 +++++------------------------
 System/Process/Internals.hs | 27 +++++++++++++++++++++++----
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/System/Process.hs b/System/Process.hs
index b73dba3..cafe2cc 100644
--- a/System/Process.hs
+++ b/System/Process.hs
@@ -111,26 +111,7 @@ import System.Posix.Signals
 -- | Construct a 'CreateProcess' record for passing to 'createProcess',
 -- representing a raw command with arguments.
 --
--- The 'FilePath' argument names the executable, and is interpreted according
--- to the platform's standard policy for searching for
--- executables. Specifically:
---
--- * on Unix systems the
---   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html execvp(3)>
---   semantics is used, where if the executable filename does not
---   contain a slash (@/@) then the @PATH@ environment variable is
---   searched for the executable.
---
--- * on Windows systems the Win32 @CreateProcess@ semantics is used.
---   Briefly: if the filename does not contain a path, then the
---   directory containing the parent executable is searched, followed
---   by the current directory, then some standard locations, and
---   finally the current @PATH at .  An @.exe@ extension is added if the
---   filename does not already have an extension.  For full details
---   see the
---   <http://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx documentation>
---   for the Windows @SearchPath@ API.
-
+-- See 'RawCommand' for precise semantics of the specified @FilePath at .
 proc :: FilePath -> [String] -> CreateProcess
 proc cmd args = CreateProcess { cmdspec = RawCommand cmd args,
                                 cwd = Nothing,
@@ -412,7 +393,7 @@ processFailedException fun cmd args exit_code =
 -- * A string to pass on standard input to the forked process.
 --
 readProcess
-    :: FilePath                 -- ^ Filename of the executable (see 'proc' for details)
+    :: FilePath                 -- ^ Filename of the executable (see 'RawCommand' for details)
     -> [String]                 -- ^ any arguments
     -> String                   -- ^ standard input
     -> IO String                -- ^ stdout
@@ -468,7 +449,7 @@ when the process died as the result of a signal.
 -}
 
 readProcessWithExitCode
-    :: FilePath                 -- ^ Filename of the executable (see 'proc' for details)
+    :: FilePath                 -- ^ Filename of the executable (see 'RawCommand' for details)
     -> [String]                 -- ^ any arguments
     -> String                   -- ^ standard input
     -> IO (ExitCode,String,String) -- ^ exitcode, stdout, stderr
@@ -747,7 +728,7 @@ runCommand string = do
      'runProcess'.
 -}
 runProcess
-  :: FilePath                   -- ^ Filename of the executable (see 'proc' for details)
+  :: FilePath                   -- ^ Filename of the executable (see 'RawCommand' for details)
   -> [String]                   -- ^ Arguments to pass to the executable
   -> Maybe FilePath             -- ^ Optional path to the working directory
   -> Maybe [(String,String)]    -- ^ Optional environment (otherwise inherit)
@@ -814,7 +795,7 @@ runInteractiveCommand string =
     in text mode then use 'hSetBinaryMode'.
 -}
 runInteractiveProcess
-  :: FilePath                   -- ^ Filename of the executable (see 'proc' for details)
+  :: FilePath                   -- ^ Filename of the executable (see 'RawCommand' for details)
   -> [String]                   -- ^ Arguments to pass to the executable
   -> Maybe FilePath             -- ^ Optional path to the working directory
   -> Maybe [(String,String)]    -- ^ Optional environment (otherwise inherit)
diff --git a/System/Process/Internals.hs b/System/Process/Internals.hs
index 4cf6b1a..d5cc90b 100644
--- a/System/Process/Internals.hs
+++ b/System/Process/Internals.hs
@@ -184,11 +184,30 @@ data CreateProcess = CreateProcess{
 
 data CmdSpec
   = ShellCommand String
-      -- ^ a command line to execute using the shell
+      -- ^ A command line to execute using the shell
   | RawCommand FilePath [String]
-      -- ^ the filename of an executable with a list of arguments.
-      -- see 'System.Process.proc' for the precise interpretation of
-      -- the @FilePath@ field.
+      -- ^ The name of an executable with a list of arguments
+      --
+      -- The 'FilePath' argument names the executable, and is interpreted
+      -- according to the platform's standard policy for searching for
+      -- executables. Specifically:
+      --
+      -- * on Unix systems the
+      --   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/execvp.html execvp(3)>
+      --   semantics is used, where if the executable filename does not
+      --   contain a slash (@/@) then the @PATH@ environment variable is
+      --   searched for the executable.
+      --
+      -- * on Windows systems the Win32 @CreateProcess@ semantics is used.
+      --   Briefly: if the filename does not contain a path, then the
+      --   directory containing the parent executable is searched, followed
+      --   by the current directory, then some standard locations, and
+      --   finally the current @PATH at .  An @.exe@ extension is added if the
+      --   filename does not already have an extension.  For full details
+      --   see the
+      --   <http://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx documentation>
+      --   for the Windows @SearchPath@ API.
+
 
 data StdStream
   = Inherit                  -- ^ Inherit Handle from parent



More information about the ghc-commits mailing list