|Anonymous | Login | Signup for a new account||2018-05-21 14:46 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007672||OCaml||standard library||public||2017-11-15 22:25||2018-05-13 23:55|
|Platform||x86_64||OS||GNU/Linux||OS Version||Debian testing|
|Target Version||Fixed in Version|
|Summary||0007672: Sys.command and Windows quoting|
|Description||When quoting several arguments in a command that will be sent to Sys.command, on must also quote the whole string for Windows cmd. This was discussed in https://github.com/janestreet/jbuilder/issues/322 [^] ; the Windows quoting rules are at |
- https://www.borngeek.com/2011/03/22/calls-to-system-in-windows/ [^]
- https://stackoverflow.com/a/9965141 [^]
Given these unusual quoting rules, adding a function to quote a full command (such as Filename.quote_command : string list -> string) should be discussed.
|Tags||No tags attached.|
That's not the first time we discuss the weird quoting conventions of cmd.exe. I'll try to find the relevant problem reports and link them here.
I'm not opposed to have a quoting function for invoking Sys.command as envisioned in the PR; only, it should be called Sys.quote_command because it has nothing to do with Filenames.
|On second thoughts, I'm not so sure that it should be called Sys.quote_command. That would probably create a circular dependency between modules Sys and Filename.|
|Closely related to https://caml.inria.fr/mantis/view.php?id=6107 [^]|
Christophe Troestler (reporter)
|@xleroy Another possibility would be Sys.run : string -> string list -> int that would take care of escaping the command and its arguments.|
Pull request here: https://github.com/ocaml/ocaml/pull/1492 [^]
The suggested "Sys.run" is unhelpful, I think, because if you want file redirections or pipes or other special shell characters in the command given to Sys.command, they must NOT be escaped. The documentation included in the pull request points this out.
|2017-11-15 22:25||Christophe Troestler||New Issue|
|2017-11-17 19:21||xleroy||Note Added: 0018669|
|2017-11-17 19:21||xleroy||Status||new => acknowledged|
|2017-11-18 18:04||xleroy||Note Added: 0018670|
|2017-11-18 23:04||nojebar||Note Added: 0018671|
|2017-11-18 23:55||Christophe Troestler||Note Added: 0018672|
|2017-11-20 15:31||xleroy||Relationship added||related to 0006107|
|2017-11-26 17:12||xleroy||Note Added: 0018689|
|2018-05-13 23:55||nojebar||Relationship added||related to 0007794|
|Copyright © 2000 - 2011 MantisBT Group|