ftell() fails on files in shared folders

Yuri Gribov tetra2005@googlemail.com
Tue Mar 20 09:48:00 GMT 2012


Corinna,

> No, it doesn't change that often.  1.7.9 is actually a year old,
> though.  Updating *might* help.
>
> Btw., assuming you call lseek(fileno(p), SEEK_CUR, 0) rather than
> ftell(p), what position does it return?

I have rewritten my program to use only low-level API (open, write,
lseek) and installed latest Cygwin. It seems that the error is caused
by O_RDWR - as soon as I change it to O_WRONLY everything starts to
work:

Local, O_WRONLY:
  C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-head/c$/test.bin
  success

Local, O_RDWR:
  C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-head/c$/test.bin rw
  success

Remote, O_WRONLY:
  C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-node01/c$/test.bin
  success

Remote, O_RDWR:
  C:\Users\gribov.y>\\s-cw-head\pgas\a.exe //s-cw-node01/c$/test.bin rw
  sizeof(data) == lseek(fd, 0, SEEK_END) failed at io.c:36

-- 
Best regards,
Yuri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: io.c
Type: text/x-csrc
Size: 934 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120320/b11f083c/attachment.bin>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list