[BUG] open(): Opening with flags O_RDONLY | O_APPEND positions the file pointer at the end of the file
Pavel Tsekov
ptsekov@syntrex.com
Wed Jul 10 07:28:00 GMT 2002
Hello, there :)
Attached is a testcase which displays the problem. On Linux it will
properly return 13, while on cygwin it returns 0.
I found this while trying to understand why MC doesn't extract
properly files from say .zip files.
I don't know exactly why they call O_RDONLY combined with O_APPEND but
I will mail the mc-devel list ASAP.
Still according to the Linux man page and SUSv2, O_APPEND should be
taken into account only when writing to the file.
Having in mind that fhandler_base::write() calls SetFilePointer
before each write, I wonder why fhandler_disk_base::open calls
SetFilePointer when it detects O_APPEND ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: open_test.c
Type: application/octet-stream
Size: 418 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020710/21fbf01a/attachment.obj>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list