Skip to content

Commit 769bb92

Browse files
committed
[DOC] Tips for space containing exe_path
1 parent 6230586 commit 769bb92

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

process.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8876,6 +8876,11 @@ proc_warmup(VALUE _)
88768876
*
88778877
* Thu Aug 31 10:06:48 AM CDT 2023
88788878
*
8879+
* A path or command name containing spaces without arguments cannot
8880+
* be distinguished from +command_line+ above, so you must quote or
8881+
* escape the entire command name using a shell in platform
8882+
* dependent manner, or use the array form below.
8883+
*
88798884
* - A 2-element array containing the path to an executable
88808885
* and the string to be used as the name of the executing process:
88818886
*
@@ -8922,6 +8927,15 @@ proc_warmup(VALUE _)
89228927
* Windows, but <code>Process.spawn 'echo', '$PATH'</code> prints the
89238928
* literal <tt>$PATH</tt>.
89248929
*
8930+
* If you want to invoke a path containing spaces with no arguments
8931+
* without shell, you will need to use a 2-element array +exe_path+.
8932+
*
8933+
* Example:
8934+
*
8935+
* path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
8936+
* spawn(path) # Raises Errno::ENOENT; No such file or directory - /Applications/Google
8937+
* spawn([path] * 2)
8938+
*
89258939
* === Execution Options
89268940
*
89278941
* Optional trailing argument +options+ is a hash of execution options.

0 commit comments

Comments
 (0)