Commit graph

181 commits

Author SHA1 Message Date
Sebastian Wilzbach
d1714c9afb minor style fixes 2016-04-27 04:18:22 +03:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Matt Kline
bed2df7e80 Avoid brute force fd close() on Linux
The current Posix implementation of spawnProcess calls close on
every fd from 3 to the max fd count (as gathered by rlimit()).
Given that the process doesn't have that many descriptors open
in the *vast* majority of cases, this is quite pessimal.

Instead, use poll() to see which descriptors are actually open,
and close those.
2016-04-04 08:42:17 -07:00
Walter Bright
e9385287c8 browse() should take const(char)[] parameter 2016-03-26 02:35:00 -07:00
H. S. Teoh
5c53be7676 Merge pull request #3977 from joakim-noah/android
Android update
2016-02-23 13:51:42 -08:00
Martin Nowak
ce2ac192c9 fix incorrect imports/fqn usages
- mostly of the form `import a.b : sym; a.b.sym();`, which is wrong b/c
  selective imports do not add the module to the current scope
2016-02-20 14:41:44 +01:00
Akihiro Shoji
2d9415dea8 Fix Document of process.d with pipe
Current document says:
```d
auto p = pipe();
p.writeEnd.writeln("Hello World");
assert (p.readEnd.readln().chomp() == "Hello World");
```

This means that buffer is yet to be flushed.
Therefore `p.readEnd.readln` can't recieve the input, for readln waits forever if the buffer is not flushed.
Then I fixed as follow:
```d
auto p = pipe();
p.writeEnd.writeln("Hello World");
p.writeEnd.flush();
assert (p.readEnd.readln().chomp() == "Hello World");
```
2016-02-15 15:28:18 +09:00
Lars T. Kyllingstad
50e3fc6b74 Merge pull request #3989 from WalterBright/zipprocess
fix problems that prevent implementing import shadowing protection
2016-02-12 08:45:46 +01:00
Walter Bright
8e6faa560f fix problems that prevent implementing import shadowing protection 2016-02-11 22:38:53 -08:00
Joakim
10c01a0614 On Android, update std.datetime to extract timezone data and some other fixes. 2016-02-10 14:25:42 +05:30
Shriramana Sharma
5978ca7831 migrate other Phobos modules to use std.exception.basicExceptionCtors 2016-01-17 10:39:37 +05:30
Mark Isaacson
963f7e4170 Issue 15276: Allow users to specify shell for executeShell, pipeShell, spawnShell
This diff: This diff makes it possible to specify your preferred shell for the various `*shell` functions in `std.process`. By default it uses the new `nativeShell` function. `nativeShell` to always returns the native system shell (see the "some history" section for why this is the default value). I chose to create `nativeShell` rather than changeing `userShell` because I think it is still valuable to have something like `userShell` around in Phobos.

The one part of this diff I'm not super thrilled by is the use of variadic arguments (easier to see than to explain); if you have a suggestion for something better I'd love to hear it :).

Note: The default shell is a breaking change for Windows, which probably *should have* been broken same as posix in the diffs listed in the history section below, but I suspect was overlooked. Find rationale behind making a breaking change at all here: https://issues.dlang.org/show_bug.cgi?id=15000.

Some history:
a524a3571b
and
f537cb50b5

Tried to move us from a world where we preferred the shell specified in the SHELL environment variable to a world where we always went with the native system shell, /bin/sh for posix. The former of those revisions was reverted in:
5b2b1fb594
Because the documentation was not updated to reflect the change.

Presently: we are in a state of schism, whereby `userShell` has behavior that does not align with what is actually used in `executeShell`, `pipeShell`, and `spawnShell`. This is something we *must* resolve.

Personal pain: This bit me when one of my scripts at work stopped working because it dependend on features that don't exist in `sh` (but do in `bash`, `zsh`, etc). It was really frustrating that there was no simple way to work around this and specify my preferred shell; it is, of course, possible to leverage the various `escape*` functions from `std.process` and `spawnProcess` to use whichever shell I prefer, but this seems like something warranting first class support. I was sad to not have something like this after a breaking change.
2016-01-05 16:46:47 -08:00
Benjamin L. Merritt
5f08c058ab Changed "Examples:" in Ddoc to "Example:" 2015-12-17 18:32:41 -08:00
k-hara
e864e53adc fix property enforcement 2015-12-04 15:42:53 +09:00
Brian Schott
c5c87895a8 Merge pull request #3716 from CyberShadow/pull-20151014-040843
Remove declarations already declared by the new Windows headers
2015-10-16 22:00:44 -07:00
Vladimir Panteleev
7c3373eacc Remove declarations already declared by the new Windows headers 2015-10-14 04:09:32 +00:00
Vladimir Panteleev
1699b5fc46 fix Issue 15076 - Get ID of current thread 2015-09-27 08:21:39 +00:00
Vladimir Panteleev
f537cb50b5 fix Issue 15000 - Changes to userShell either need to be reverted or the std.process documentation needs to be updated 2015-09-03 11:47:44 +00:00
Vladimir Panteleev
5b2b1fb594 Revert "fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable"
This reverts commit a524a3571b.
2015-09-03 11:47:43 +00:00
Jonathan M Davis
7b4abd0aa7 Move deprecations along. 2015-08-29 17:01:23 -07:00
k-hara
6302257b0c Prevent using alloca and tempCString in same functions
Currently using both alloca and finalizers (==destructor call) in a function is unsupported excepting Win32 (issue 3753). However compiler doesn't recognize implicit destructor calls sometimes, and they're not called during stack unwinding (issue 14708).

For the workaround, replace alloca call with malloc + scope(exit) free.
2015-06-21 19:17:16 +09:00
Walter Bright
cb5aa5339e add comment about Bugzilla 14696 2015-06-16 13:44:47 -07:00
Walter Bright
97485c5445 std.process.spawnProcessImpl memory corruption bug 2015-06-16 13:03:15 -07:00
Walter Bright
6ad3081c10 std.process.browse() - fix memory corruption bug 2015-06-11 20:04:04 -07:00
Joakim
3352c90c2e Separate linux kernel, glibc, and bionic APIs where appropriate 2015-05-27 21:54:52 -05:00
Steven Schveighoffer
cdd73be74c Merge pull request #3148 from CyberShadow/pull-20150405-052650-process-14408
fix Issue 14408 - std.process: Can't start interactive process from Wind...
2015-04-09 14:13:05 -04:00
Steven Schveighoffer
eecc989b2c Merge pull request #3160 from CyberShadow/pull-20150407-122150
fix Issue 14422 - std.process: Pipes do not append to files on Win64
2015-04-09 10:28:18 -04:00
Vladimir Panteleev
b28eb9fab8 fix Issue 14422 - std.process: Pipes do not append to files on Win64 2015-04-07 15:29:12 +00:00
Vladimir Panteleev
237a1c1477 fix Issue 14408 - std.process: Can't start interactive process from Windows GUI application 2015-04-05 05:32:08 +00:00
Vladimir Panteleev
865f36fcce Merge pull request #3051 from MartinNowak/fix14282
fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable
2015-04-04 04:33:42 +00:00
Rainer Schuetze
3566651cbb fix version: use CRuntime_Microsoft instead of Win64 2015-03-20 08:54:12 +01:00
Martin Nowak
a524a3571b fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable 2015-03-13 21:33:51 +01:00
Daniel Murphy
f255c9e689 Replace more implicit array to bool conversions 2015-01-28 16:33:12 +11:00
Ferdinand Majerech
60f87c0f26 Mention that invalid process IDs are negative. 2015-01-24 16:50:11 +01:00
Andy Colson
6610dc55e1 std.process example code 2015-01-20 20:40:42 -06:00
Ilya Yaroshenko
2c744b54e1 std.range: constraints => primitives
See discussion and voting in #2661
2014-11-23 20:05:20 +03:00
Ilya Yaroshenko
acba2b66ec std.process: clean imports
fix

fix

fix

fix

fix
2014-11-15 19:15:18 +03:00
Martin Nowak
c855945f46 Merge pull request #2614 from Geod24/fix-license-doc
[DDOC] Usage of WEB macro for License everywhere
2014-10-17 00:16:49 +02:00
Geod24
0fb95b8c27 Usage of WEB macro for License everywhere 2014-10-15 11:30:42 +02:00
Joakim
093d636de4 Deprecate std.c.* and move all remaining declarations to core.stdc.* 2014-10-14 09:26:21 -05:00
H. S. Teoh
d12ab1cf38 Merge pull request #2503 from CyberShadow/pull-20140909-141704
fix Issue 13446 - Can't use executeShell/escapeShellFileName to redirect to file whose name starts with &
2014-09-19 12:38:56 -07:00
H. S. Teoh
449ab2a39e Merge pull request #2514 from CyberShadow/pull-20140915-022527
fix Issue 13477 - std.process should ignore unnamed service variables on Windows
2014-09-19 11:40:33 -07:00
Vladimir Panteleev
4e60afae79 fix Issue 13477 - std.process should ignore unnamed service variables on Windows 2014-09-18 19:27:52 +00:00
Brad Roberts
8d1c89d2a6 Merge pull request #2432 from rainers/coff32
COFF support for Win32
2014-09-11 13:55:13 -07:00
Vladimir Panteleev
337d82bb37 fix Issue 13446 - Can't use executeShell/escapeShellFileName to redirect to file whose name starts with &
Discovered and verified by -version=unittest_burnin
2014-09-11 09:38:36 +00:00
Andrej Mitrovic
f35c21972f Merge pull request #2504 from CyberShadow/pull-20140909-143654
fix Issue 13447 - Do not escape process parameters unless necessary
2014-09-09 18:04:05 +02:00
Andrej Mitrovic
d479da3392 Merge pull request #2502 from CyberShadow/pull-20140909-140509
fix Issue 13445 - std.process fails to create process with empty (non-null) working directory
2014-09-09 17:26:14 +02:00
Ketmar Dark
462163a5b0 std.process: Fix using 0 as invalid FD value, use -1 instead 2014-09-09 14:45:48 +00:00
Vladimir Panteleev
09a0b876c8 fix Issue 13447 - Do not escape process parameters unless necessary 2014-09-09 14:38:01 +00:00
Vladimir Panteleev
e0392714f9 std.process: Test random characters at filename start as well 2014-09-09 14:21:33 +00:00