-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unix.open_process_args_*: look up program in PATH #10084
Changes from 4 commits
2244deb
396b178
46845e4
228a0c2
40ada47
9cbbdc6
42e155e
e145762
ed47664
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -881,6 +881,9 @@ val open_process_args_in : string -> string array -> in_channel | |
The standard output of the command is redirected to a pipe, which can be read | ||
via the returned input channel. | ||
|
||
The program is looked up in the [PATH] (this behaviour changed in 4.12; | ||
previously the program was interpreted relative to the current directory). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Elsewhere in unix.mli we write "The executable file is searched in the path". (4 occurrences.) Also, you first talk about "the command" and then "the program". For me, "the command" is a shell command line, as used in Also, "the program was interpreted relative to the current directory" is still true: the path is not searched for programs like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I pushed revised docs for the |
||
|
||
@since 4.08.0 *) | ||
|
||
val open_process_args_out : string -> string array -> out_channel | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
spawn
is not exported, we should makeusepath
a labelled argument instead of using comments to alleviate the problems of non-labelled boolean arguments.(Looking at the code, I see that
spawn
is an external. Can external have labels too?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Externals can have labeled and even optional arguments. There are examples elsewhere in this
unix.ml
file.This said,
spawn
is not exported, and is called only twice inunix.ml
, so it doesn't need to have a bulletproof interface.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'm not adding a label as it seems a bit overkill in this case...