AbstractOperatingSystem.st
branchjv
changeset 19496 7613c0fb5f3c
parent 19431 3e697e4bcbf5
parent 19491 9c451dfc5949
child 19637 aceade7525bb
equal deleted inserted replaced
19478:1f5aa87f6170 19496:7613c0fb5f3c
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1988 by Claus Gittinger
     4  COPYRIGHT (c) 1988 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  1924 
  1926 
  1925     "
  1927     "
  1926      String streamContents:[:s|OperatingSystem
  1928      String streamContents:[:s|OperatingSystem
  1927 	executeCommand:'pwd'
  1929 	executeCommand:'pwd'
  1928 	outputTo:s
  1930 	outputTo:s
       
  1931      ]
       
  1932     "
       
  1933 !
       
  1934 
       
  1935 executeCommand:aCommandString outputTo:anOutStreamOrNil errorTo:anErrStreamOrNil
       
  1936     "execute the unix command specified by the argument, aCommandString.
       
  1937      If aCommandString is a String, the commandString is passed to a shell for execution
       
  1938      - see the description of 'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual).
       
  1939      If aCommandString is an Array, the first element is the command to be executed,
       
  1940      and the other elements are the arguments to the command. No shell is invoked in this case.
       
  1941      Return true if successful, false otherwise."
       
  1942 
       
  1943      ^ self
       
  1944         executeCommand:aCommandString
       
  1945         inputFrom:nil
       
  1946         outputTo:anOutStreamOrNil
       
  1947         errorTo:anErrStreamOrNil
       
  1948         auxFrom:nil
       
  1949         environment:nil
       
  1950         inDirectory:nil
       
  1951         lineWise:false
       
  1952         onError:[:status| false]
       
  1953 
       
  1954     "
       
  1955      String streamContents:[:s|OperatingSystem
       
  1956         executeCommand:'ls'
       
  1957         outputTo:s
       
  1958      ]
       
  1959     "
       
  1960 
       
  1961     "
       
  1962      String streamContents:[:s|OperatingSystem
       
  1963         executeCommand:'pwd'
       
  1964         outputTo:s
  1929      ]
  1965      ]
  1930     "
  1966     "
  1931 !
  1967 !
  1932 
  1968 
  1933 executeCommand:aCommandString outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory
  1969 executeCommand:aCommandString outputTo:outStreamOrNil errorTo:errStreamOrNil inDirectory:aDirectory