This is the mail archive of the
mailing list for the Cygwin project.
Re: Tail not reading to end of input
-----BEGIN PGP SIGNED MESSAGE-----
According to smr xxxx on 4/14/2008 11:56 AM:
| Hi, I've just rebuilt my machine and done a clean install of the
| latest Cygwin, and am having a problem with tail. I'm wanting to know
| whether this is a known issue before digging deeper.
Not known to me, but I (thankfully) don't use Vista.
| When running a command such as "dir /s /a cygwin | tail -2" (from C:\)
Is this in cmd.exe or a cygwin shell? At any rate, you haven't followed
directions by posting 'cygcheck -svr' output as a text attachment, which
might provide us more insight into your setup.
| Problem reports: http://cygwin.com/problems.html
| If I first redirect the output of the dir command to a file and tail
| that then all is well. Even running "type filename | tail -2" works.
| Also, if I dos2unix the stream inplace (ie. "dir /s /a cygwin |
| dos2unix | tail -2") it works correctly. Note that I installed with
| Unix file type (as always).
Unix file mode during cygwin's installation only affects regular files,
not pipes. I don't know if the CR's being generated by the non-cygwin
tools are interfering with tail, but tail attempts to always operate in
binary mode, so I don't see how this could be broken.
| 1. S_ISREG (stats.st_mode) returns 0 on XP, but 1 on Vista (I
| haven't yet determined if this is an Enterprise-only or an SP1-only
| 2. lseek() fails on XP, but succeeds on Vista. The SEEK_CUR below
Are you sure this is on the same type of file? You can't lseek on pipes,
and pipes are not regular files. So maybe there is some sort of issue
where piped stdin inherited from a non-cygwin process on Vista wrongly
looks like a regular file instead of a pipe, causing confusion within
Don't work too hard, make some time for fun as well!
Eric Blake firstname.lastname@example.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html