Hi,
I want to list all processes by scanning /proc/. The following
code doesn't work
[code]
foreach (string fstatm; dirEntries("/proc/", "[0-9]*",
SpanMode.shallow)) {
writefln("pid %s", fstatm);
}
[/code]
as it only list a few entries before exiting
[code]
pid /proc/9
pid /proc/93
On Sunday, 17 September 2017 at 08:15:58 UTC, Ky-Anh Huynh wrote:
Hi,
I want to list all processes by scanning /proc/. The following
code doesn't work
[code]
foreach (string fstatm; dirEntries("/proc/", "[0-9]*",
SpanMode.shallow)) {
writefln("pid %s", fstatm);
}
[/code]
as it only
On Sunday, 17 September 2017 at 08:32:24 UTC, Ky-Anh Huynh wrote:
My bad. Range doesn't support. The correct pattern is
[code]
foreach (string fstatm; dirEntries("/proc/", "[0123456789]*",
SpanMode.shallow)) {
writefln("pid %s", fstatm);
}
[/code]
Is there a way to make this simpler?
On Sunday, 17 September 2017 at 08:37:33 UTC, Ky-Anh Huynh wrote:
The official documentation here
https://dlang.org/phobos/std_path.html#.globMatch refers to the
wiki page https://en.wikipedia.org/wiki/Glob_%28programming%29
. However I think the popular glob rules (man 7 glob) are not
suppor
On Tuesday, 19 September 2017 at 06:35:18 UTC, Matt Jones wrote:
On Sunday, 17 September 2017 at 08:37:33 UTC, Ky-Anh Huynh
wrote:
[...]
The problem with matching "[0123456789]*" is that it will match
files like "1blah" and "8stuff". It looks like glob patterns
are not robust enough to han
On Tuesday, 19 September 2017 at 13:32:29 UTC, Ky-Anh Huynh wrote:
Btw, is that a bit weird that range is not supported in glob
pattern :) Is there a design reason for this?
That is strange. But then again, every glob library I've seen
works a little bit differently.
On Tuesday, 19 September 2017 at 18:32:06 UTC, Matt Jones wrote:
On Tuesday, 19 September 2017 at 13:32:29 UTC, Ky-Anh Huynh
wrote:
Btw, is that a bit weird that range is not supported in glob
pattern :) Is there a design reason for this?
That is strange. But then again, every glob library
On Sunday, 17 September 2017 at 08:15:58 UTC, Ky-Anh Huynh wrote:
Hi,
I want to list all processes by scanning /proc/. The following
code doesn't work
[code]
foreach (string fstatm; dirEntries("/proc/", "[0-9]*",
SpanMode.shallow)) {
writefln("pid %s", fstatm);
}
[/code]
as it only