byteblitz icon indicating copy to clipboard operation
byteblitz copied to clipboard

Process redirected input as a file

Open arthurbacci opened this issue 2 years ago • 0 comments

The command curl https://idk/a.tar.gz | byteblitz a.tar.gz should firstly check if a.tar.gz exists. If it does, exit with an error, otherwise, write the input to the file and open it normally. Since stdin is now curl's output, for the user to be able to edit the file, the program needs to open the input of the terminal. This can be done by opening /dev/tty (since SUSv1). Checking if the input is a pipe can be done with this trait from rust's std.

Also, it should behave correctly when used alongside #15, as in curl https://idk/a.tar.gz | byteblitz hex /tmp/deletelater.tar.gz > hexadecimal.txt.

arthurbacci avatar Jan 29 '24 19:01 arthurbacci