summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-01-21 20:02:34 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-01-24 12:44:40 +0900
commit769bb924b2e4ece7c1884f4adeb29a49d03bd45a (patch)
treec51afc0d38c284b5581fc6c6a6d89089635b7c98 /process.c
parent623058649e18e7a65b8ba3498b6524fad482b3e0 (diff)
[DOC] Tips for space containing `exe_path`
Diffstat (limited to 'process.c')
-rw-r--r--process.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/process.c b/process.c
index 31810d9669..3eb1ca4092 100644
--- a/process.c
+++ b/process.c
@@ -8876,6 +8876,11 @@ proc_warmup(VALUE _)
*
* Thu Aug 31 10:06:48 AM CDT 2023
*
+ * A path or command name containing spaces without arguments cannot
+ * be distinguished from +command_line+ above, so you must quote or
+ * escape the entire command name using a shell in platform
+ * dependent manner, or use the array form below.
+ *
* - A 2-element array containing the path to an executable
* and the string to be used as the name of the executing process:
*
@@ -8922,6 +8927,15 @@ proc_warmup(VALUE _)
* Windows, but <code>Process.spawn 'echo', '$PATH'</code> prints the
* literal <tt>$PATH</tt>.
*
+ * If you want to invoke a path containing spaces with no arguments
+ * without shell, you will need to use a 2-element array +exe_path+.
+ *
+ * Example:
+ *
+ * path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
+ * spawn(path) # Raises Errno::ENOENT; No such file or directory - /Applications/Google
+ * spawn([path] * 2)
+ *
* === Execution Options
*
* Optional trailing argument +options+ is a hash of execution options.