diff -r b07f338c6338 -r 723fac611344 AbstractOperatingSystem.st --- a/AbstractOperatingSystem.st Wed Aug 09 22:52:20 2017 +0200 +++ b/AbstractOperatingSystem.st Wed Aug 09 23:01:35 2017 +0200 @@ -1413,36 +1413,38 @@ avoid blocking on pipes. Special for windows: - you can control (have to - sigh) if a window should be shown for the command or not. - This is the OS's H_SHOWWINDOW argument. - If you pass nil as showWindow-argument, the OS's default is used for the particular - command, which is correct most of the time: i.e. a notepad will open its window, other (non-UI) - executables will not. - However, some command-line executables show a window, even if they should not. - (and also, there seems to be an inconsistency between windows7 and newer windows: in newer, - a shell command opens a cmd-window, whereas in windows7 it did not) - In this case, pass an explicit false argument to suppress it. - This argument is ignored on Unix systems. - See examples below." - - |osProcess| - - osProcess := OSProcess new - command:aCommandStringOrArray; - inStream:anInStream; - outStream:anOutStream; - errorStream:anErrStream; - auxStream:anAuxStream; - environment:environmentDictionary; - directory:dirOrNil; - lineWise:lineWise; - showWindow:showWindowBooleanOrNil. - - osProcess execute ifFalse:[ - aBlock value:osProcess exitStatus. - ^ false. - ]. - ^ true. + you can control (have to - sigh) if a window should be shown for the command or not. + This is the OS's H_SHOWWINDOW argument. + If you pass nil as showWindow-argument, the OS's default is used for the particular + command, which is correct most of the time: i.e. a notepad will open its window, other (non-UI) + executables will not. + However, some command-line executables show a window, even if they should not. + (and also, there seems to be an inconsistency between windows7 and newer windows: in newer, + a shell command opens a cmd-window, whereas in windows7 it did not) + In this case, pass an explicit false argument to suppress it. + This argument is ignored on Unix systems. + See examples below." + + |osProcess| + + osProcess := OSProcess new + command:aCommandStringOrArray + environment:environmentDictionary + directory:dirOrNil + inStream:anInStream + outStream:anOutStream + errorStream:anErrStream + auxStream:anAuxStream + showWindow:showWindowBooleanOrNil + lineWise:lineWise. + + osProcess execute ifFalse:[ + aBlock value:osProcess exitStatus. + ^ false. + ]. + ^ true. + + "Modified: / 09-08-2017 / 22:56:15 / cg" ! executeCommand:aCommandStringOrArray inputFrom:anInStream outputTo:anOutStream @@ -5458,7 +5460,10 @@ ! encodePathOrCommandInput:pathNameOrInputToAProgram - "encode the pathNameOrInputToAProgram for use with system calls or to be sent to a program. + "encode the pathNameOrInputToAProgram for use with system calls, + to be sent to a program, used as cmmand line argument, + or to be used as shell environment value. + E.g. linux system calls accept single byte strings only, so the pathName has to be UTF-8 encoded, before using it in a system call. Here, the original string is returned; @@ -5467,6 +5472,7 @@ ^ pathNameOrInputToAProgram "Created: / 01-03-2017 / 11:40:11 / cg" + "Modified: / 09-08-2017 / 23:00:29 / cg" ! encodeTerminalOutput:aString