Re: ftell() fails on files in shared folders

2012-03-22 Thread Yuri Gribov
> Sorry, but I really don't know how to help here. I can't reproduce > the problem and apparently nobody else can. Fair enough. Let's see if someone else comments on this. I'm thinking about Perhaps I'll get time to write a plain WinAPI app which repros this and then ask MS. -- Best regards, Y

Re: ftell() fails on files in shared folders

2012-03-22 Thread Corinna Vinschen
On Mar 21 21:02, Yuri Gribov wrote: > Corinna, > > > or it's the native NT equivalent NtQueryInformationFile function > > with the FileStandardInformation info class. Cygwin uses the latter. > > My idea was that this was a known error but I did not find anything > useful in google. > > > Is it

Re: ftell() fails on files in shared folders

2012-03-21 Thread Yuri Gribov
Corinna, > or it's the native NT equivalent NtQueryInformationFile function > with the FileStandardInformation info class. Cygwin uses the latter. My idea was that this was a known error but I did not find anything useful in google. > Is it possible that some kind of virus checker influences th

Re: ftell() fails on files in shared folders

2012-03-21 Thread Corinna Vinschen
On Mar 21 06:56, Yuri Gribov wrote: > Corinna, > > > the problem is obviously that your remote filesystem returns 0 as the > > current file size. > > Which WinAPI does that? I can try searching it. I don't understand. What do you want to search? It's the GetFileSize or GetFileSizeEx function

Re: ftell() fails on files in shared folders

2012-03-20 Thread Yuri Gribov
Corinna, > the problem is obviously that your remote filesystem returns 0 as the current > file size. Which WinAPI does that? I can try searching it. > What OS are your remote filesystems running on? That's Windows Server 2008 SP1. -- Best regards, Yuri -- Problem reports: http://cygw

Re: ftell() fails on files in shared folders

2012-03-20 Thread Corinna Vinschen
On Mar 21 00:12, Yuri Gribov wrote: > > First of all, there's a bug in your testcase. > > Nice catch. With fixed code O_RDWR and O_WRONLY no longer influence > the result but the bug still remains. > > > What filesystem is your remote FS?  Please run > > Done. All nodes seem to have same volume

Re: ftell() fails on files in shared folders

2012-03-20 Thread Corinna Vinschen
On Mar 20 13:48, Yuri Gribov wrote: > 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 p

Re: ftell() fails on files in shared folders

2012-03-20 Thread Yuri Gribov
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)

Re: ftell() fails on files in shared folders

2012-03-19 Thread Corinna Vinschen
On Mar 18 23:41, Yuri Gribov wrote: > > No.  In my examples ./test.bin and > > //this-machine/c\$/cygwin/home/corinna/test.bin refer to the same file, > > //other-machine/c\$/cygwin/home/corinna/test.bin is a file on another > > machine. > > Hm, I'm out of clues then. These machines have very simp

Re: ftell() fails on files in shared folders

2012-03-18 Thread Yuri Gribov
> No.  In my examples ./test.bin and > //this-machine/c\$/cygwin/home/corinna/test.bin refer to the same file, > //other-machine/c\$/cygwin/home/corinna/test.bin is a file on another > machine. Hm, I'm out of clues then. These machines have very simple setups and I did not find any app from Cygwin

Re: ftell() fails on files in shared folders

2012-03-18 Thread Corinna Vinschen
On Mar 18 20:54, Yuri Gribov wrote: > Corinna, Please, don't http://cygwin.com/acronyms/#TOFU Thanks. > > Corinna, > > > > Thanks for your answer! > > > >> Wrong style. > > > > Yeah, I know but it worked this time and it's so handy to just use > > good ol' DOS paths... > > > >>  $ ./a ./test.bin

Re: ftell() fails on files in shared folders

2012-03-18 Thread Yuri Gribov
Corinna, Is your $HOME shared across all your nodes? Can you try running on c$/test.bin? On Sun, Mar 18, 2012 at 8:41 PM, Yuri Gribov wrote: > Corinna, > > Thanks for your answer! > >> Wrong style. > > Yeah, I know but it worked this time and it's so handy to just use > good ol' DOS paths... > >

Re: ftell() fails on files in shared folders

2012-03-18 Thread Corinna Vinschen
On Mar 18 18:55, Yuri Gribov wrote: > Hi all, > > I have recently ran into a problem with Cygwin accessing files located > in shared folders. The attached program does fwrite() and then checks > file size with ftell(). Ftell() returns correct results in any of > following situations: > 1) I access

ftell() fails on files in shared folders

2012-03-18 Thread Yuri Gribov
Hi all, I have recently ran into a problem with Cygwin accessing files located in shared folders. The attached program does fwrite() and then checks file size with ftell(). Ftell() returns correct results in any of following situations: 1) I access local file: c:/test.bin 2) I access file via UNC-