Open noahra opened 8 months ago
POSIX has isatty()
. Some of the libraries used probably implement this feature.
Actually it's part of Rust's std :). https://doc.rust-lang.org/std/io/trait.IsTerminal.html
A question before implementing it:
echo "idk" | byteblitz idk.txt
create idk.txt
if it doesn't exist and return an error if it does. And echo "idk" | byteblitz
be simply invalid?SUSv1's System Interface Definitions, Issue 4, Version 2 describes the behaviour of /dev/tty
for getting access to the terminal to ignore redirections (pipes).
This should be portable to nearly all unix-like systems.
@arthurbacci The Issue is now updated. I was unclear with my intentions, I hope it is clearer now.
ok, I will open a separate issue for the output
Issue Description:
Feature Request: Output Redirection to file
Background:
Currently, byteblitz allows users to view the binary content of files. However, it cannot directly redirect the output to a file using the standard output redirection operator (>).
Proposed Feature: Implement functionality in byteblitz so that users can redirect the formatted output directly to a target file using the > operator. The expected command structure after implementation would be:
Example: If a user wants to view the contents of a file named
cool.png
in hexadecimal , and save the formatted result intooutput.txt
, they could use: