andrewchambers / janetsh

A powerful new shell that uses the janet programming language for both the implementation and repl.
https://janet-shell.org
MIT License
372 stars 13 forks source link

File descriptors as arguments #173

Open andrewchambers opened 5 years ago

andrewchambers commented 5 years ago

Because janet shell is typed, we can do something like:

cat (something returning core/file) -> cat /dev/fd/63

This can work in tandem with coprocesses.

questions, does this work on all platforms? if not, can we make it work using temporary mkfifo, this probably would involve a list of paths to unlink on job cleanup.

Should we close the descriptor after forking in the parent?