-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
tail
: piped or redirected input on windows and android platforms is not implemented
#3881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Handling piped or redirected input for tail was added only recently with the primary focus on Linux in order to pass the GNU test suite.
PRs to improve and expand this functionality to other platforms are of course always welcome. If you decide to work on this, please keep in mind to also activate the tests regarding piped input in
Keep in mind that the status, e.g. if a path is tailable or not, can change during runtime with |
Thanks for the tip. I can try adding windows to the functionality of tail, at least with regard of piped input. I currently don't have a working android or macos environment for testing. |
tail
: piped or redirected input on windows and android platforms is brokentail
: piped or redirected input on windows and android platforms is not implemented
When input comes from a pipe or fifo on windows and android platforms there is no output and no processing of that input, at all. This is part of the problem when determining if the input is a fifo, pipe, file etc. A related issue is #3845. The if check here
coreutils/src/uu/tail/src/tail.rs
Line 439 in 0dbcdde
fails because path_is_tailable resolves to false because the check in
path.is_tailable()
coreutils/src/uu/tail/src/tail.rs
Line 1635 in 0dbcdde
returns false. On windows platforms (and I assume on android platforms, too) the statement
self.is_file() || self.exists() = false
resolves to false. This leads to the input not handled and silently ignored, since theif ... else if .. else if
chain above misses anelse
branch, where I would at least expect an error message. To me, the determination oftailable
and if a path isfifo, pipe
looks broken and is scattered over a 2000 lines file. Wouldn't it be clearer to determine with which kind of input and files we're dealing with right from the start when parsing the settings, store what we've found in a struct or enum and then handle all cases? Looking at this big tail file. refactoring tail.rs to be clearer would help resolving the different handling of input on different platforms.The text was updated successfully, but these errors were encountered: