Re: D: How do I pipe (|) through three programs using std.process?

2023-11-12 Thread BoQsc via Digitalmars-d-learn
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

Re: DMD: How to compile executable without producing .obj file?

2023-11-12 Thread novice2 via Digitalmars-d-learn
on windpows you can hide (move .obj away from sources dir) by add to compile command -od="%TEMP%\dmd\myproject"

Re: D: How do I pipe (|) through three programs using std.process?

2023-11-12 Thread Adam D Ruppe via Digitalmars-d-learn
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

Re: D: How do I pipe (|) through three programs using std.process?

2023-11-12 Thread BoQsc via Digitalmars-d-learn
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) {

Re: D: How do I pipe (|) through three programs using std.process?

2023-11-12 Thread BoQsc via Digitalmars-d-learn
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