This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: fstat st_size on open files on Parallels filesystem is wrong
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: lennox at cs dot columbia dot edu, cygwin at cygwin dot com
- Date: Mon, 21 Apr 2014 22:34:17 +0400
- Subject: Re: fstat st_size on open files on Parallels filesystem is wrong
- Authentication-results: sourceware.org; auth=none
- References: <21333 dot 25325 dot 11106 dot 958642 at compute01 dot cs dot columbia dot edu>
- Reply-to: cygwin at cygwin dot com
Greetings, lennox@cs.columbia.edu!
> I’m running cygwin64 1.7.29 in a Windows 8.1 Pro virtual machine, running in
> Parallels Desktop 9.0.24229 on Mac OS X 10.9.2.
> Parallels Desktop automatically mounts my Mac OS X home directory as a Z:
> drive in Windows. Cygwin mount reports this drive as being type "prlsf".
> Unfortunately, I've discovered that if I have an open file on this
> filesystem which has been written to, the size returned by Cygwin fstat() on
> the open file is wrong. A stat() of the file after it's been closed is
> correct.
> This has the consequence that emacs always thinks saved files have been
> modified externally, since emacs looks at files' sizes (as well as their
> modification times) to detect external changes. This makes emacs
> near-unusable.
> This problem does not occur for files in my Cygwin home directory, or other
> locations mounted on my Windows C: drive.
> I've attached a simple unit test program that illustrates the problem.
> I've also attached my cygcheck -s -v -r output.
> Any ideas? Is this a Cygwin bug, a Parallels bug, or something else?
> Glancing over the Cygwin code, I see that there are a few cases where fstat
> has special cases for certain filesystem types.
You never flushing the buffer in your test code, or I'm reading it wrong?
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 21.04.2014, <22:33>
Sorry for my terrible english...