Bug 11363 – std.process should offer a way to run a executable with a given working directory

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-26T07:27:00Z
Last change time
2014-09-09T14:12:21Z
Keywords
pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2013-10-26T07:27:38Z
The documentation of std.process does not give a example how to run a command in a different working directory. Reading the source code I got the opinion that this feature is simply not implemented. It would be great if this feature would be added to std.process. It should be trivial to implement on windows as CreateProcess already offers a parameter for specifying the working directory. I don't know however what the situation on linux and mac is.
Comment #1 by dlang-bugzilla — 2014-02-11T16:03:10Z
Comment #2 by dfj1esp02 — 2014-02-18T08:32:00Z
workDirFD = open(toStringz(workDir), O_RDONLY); How this behaves if workDir is not null, but empty?
Comment #3 by ketmar — 2014-09-09T13:58:44Z
(In reply to Sobirari Muhomori from comment #2) > workDirFD = open(toStringz(workDir), O_RDONLY); > How this behaves if workDir is not null, but empty? workDirFD will be "-1" (i.e. open() fails).
Comment #4 by dlang-bugzilla — 2014-09-09T14:09:36Z
It fails on Windows too. Is it a bug? If you specify empty / non-null parameter to the OS API it will fail as well.
Comment #5 by dlang-bugzilla — 2014-09-09T14:12:21Z