소스 검색

clarify OS.execute usage, add examples

Todd Ross 7 년 전
부모
커밋
b57dcf446e
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      doc/classes/OS.xml

+ 12 - 1
doc/classes/OS.xml

@@ -87,7 +87,18 @@
 			<argument index="3" name="output" type="Array" default="[  ]">
 			</argument>
 			<description>
-				Execute the binary file in given path, optionally blocking until it returns. A process ID is returned.
+				Execute the file at the given path, optionally blocking until it returns.
+				Platform path resolution will take place.  The resolved file must exist and be executable.
+				Returns a process id.
+				For example:
+				[codeblock]
+				var output = []
+				var pid = OS.execute('ls', [], true, output)
+				[/codeblock]
+				If you wish to access a shell built-in or perform a composite command, a platform specific shell can be invoked.  For example:
+				[codeblock]
+				var pid = OS.execute('CMD.exe', ['/C', 'cd %TEMP% &amp;&amp; dir'], true, output)
+				[/codeblock]
 			</description>
 		</method>
 		<method name="find_scancode_from_string" qualifiers="const">