On Saturday, 18 November 2023 at 18:09:53 UTC, BoQsc wrote:
Latest iteration on this thread.
Limitations:
* pipes through two programs.
* very verbose, hard to use.
What exactly are you trying to achieve?
```
import std;
import std.process;
version (Windows) { enum Find = "find"; }
version
Latest iteration on this thread.
Limitations:
* pipes through two programs.
* very verbose, hard to use.
```
import std;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) { enum Find = "grep"; }
void pipeTo(Pipe p, string nextprogram){
spawnShell(nextprogram
On Saturday, 11 November 2023 at 17:29:14 UTC, BoQsc wrote:
https://dlang.org/library/std/process.html
How do I pipe (|) through three programs using std.process?
https://dev.to/jessekphillips/piping-process-output-1cai
Your issue with [Find, "Hello"] might be
[Find, "\&quo
To make this thread more complete, here is the final version.
```
import std.stdio;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) { enum Find = "grep"; }
int main (string [] args)
{
auto p1 = pipe;
auto p2 = pipe;
auto pid1 = spawnShell("echo HelloWorl
On Sunday, 12 November 2023 at 13:39:25 UTC, BoQsc wrote:
However the question of why `spawnProcess(["find", "string to
find"]` is not working and produces error is still unresolved.
spawnProcess always encodes its arguments in a very specific way
and the receiving programs are not always comp
Using `spawnShell` it all seem to work.
However the question of why `spawnProcess(["find", "string to
find"]` is not working and produces error is still unresolved.
Works with `spawnShell`:
```
import std.stdio;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) {
On Windows:
While trying to use `spawnshell` I discovered that I can not use
any alphabetical letters inside the `spawnProcess([Find,
"Hello"])` it all works when they are numerical `[Find, "6515"]`.
As of recent testing `[Find, "df123"]` also is acceptable,
but not when letter is on the righ
On Saturday, 11 November 2023 at 17:29:14 UTC, BoQsc wrote:
https://dlang.org/library/std/process.html
How do I pipe (|) through three programs using std.process?
```
echo This is a sample text | find "sample" | find "text"
```
```d
import std.stdio;
import std.proces
Am 24.10.2013 19:03, schrieb Timothee Cour:
+1
this is a command use case. Further,relying on shell such as cd subdir
&& foo is fragile: if it fails, we're not sure whether it's because it
couldn't cd to subdir or because of foo.
Woudl the following be as efficient?
system_in_dir(string dir, st
+1
this is a command use case. Further,relying on shell such as cd subdir &&
foo is fragile: if it fails, we're not sure whether it's because it
couldn't cd to subdir or because of foo.
Woudl the following be as efficient?
system_in_dir(string dir, string action){
auto path=getcwd
scope(exit)
c
Am 24.10.2013 09:06, schrieb simendsjo:
On Thursday, 24 October 2013 at 06:25:40 UTC, Benjamin Thaut wrote:
As far as I can tell std.process can only run commands in the working
directory of the currently executing function. I want to execute a
certain program inside a subdirectory on windows an
On Thursday, 24 October 2013 at 06:25:40 UTC, Benjamin Thaut
wrote:
As far as I can tell std.process can only run commands in the
working directory of the currently executing function. I want
to execute a certain program inside a subdirectory on windows
and can't get it to work:
myproject
|-
As far as I can tell std.process can only run commands in the working
directory of the currently executing function. I want to execute a
certain program inside a subdirectory on windows and can't get it to work:
myproject
|- subdir
So my executable has "myproject" as working directory. And I
Graham
> Try giving an absolute path to 'mkdir'. I'm fairly sure that the exec*
>> family does not use the PATH environment.
>>
>
>
I tried the different versions and used execvp precisely because it's
supposed to provide the path. But I admit I never tried giving it an entire
path.
BCS:
> That
Hello Graham,
On Fri, 11 Jun 2010 19:09:04 +, Philippe Sigaud wrote:
OK, this is a real newbie question:
How can I use std.process?
when I do:
import std.process;
void main() {
execvp("mkdir", ["test"]);
}
nothing happens.
What am I doing wrong?
I'm on Vista there, didn't try the equi
On Fri, 11 Jun 2010 19:09:04 +, Philippe Sigaud wrote:
> OK, this is a real newbie question:
>
> How can I use std.process?
>
> when I do:
>
> import std.process;
>
> void main() {
> execvp("mkdir", ["test"]);
> }
>
> nothing happens.
>
> What am I doing wrong?
> I'm on Vista there,
OK, this is a real newbie question:
How can I use std.process?
when I do:
import std.process;
void main() {
execvp("mkdir", ["test"]);
}
nothing happens.
What am I doing wrong?
I'm on Vista there, didn't try the equivalent under Linux.
Philippe
17 matches
Mail list logo