Setup
- Symfony Console application.
- Packed into a Phar with Box.
- Distributed as an executable for Win, Linux, and MacOS with PHPMicro.
Execution
- MSYS2 on Win11.
make importcallsapp import < "$filename"in a loop for an ordered list of inputs.- Alternatively,
cat "$filename" | app import.
- Alternatively,
Problem
Cannot read from STDIN: ftell(STDIN) returns false. There’s no data in the stream. Similar story with fopen('php://stdin', 'r').
winpty
Without winpty, I see my debug output, and can e.g. inspect the stream (that’s how I know it’s empty).
With winpty, none of that happens, and instead I get:
$ winpty un1q import:generic < datafile.csv
stdin is not a tty
Remarks
Works fine on Linux. I don’t really understand how MSYS2 works, especially with streams and pipes. From what I understood, it should transform my Bash syntax into something it runs in CMD or PowerShell (none of which I’m very familiar with).