patch to allow touch to work on HPFS (and others, maybe??)

Eric Blake ebb9@byu.net
Mon Feb 14 16:46:00 GMT 2005


Corinna Vinschen <vinschen <at> redhat.com> writes:
> 
> That could be a result of the Cygwin internals.  I assume that the
> CreateFile call requesting any write access fails on both filesystems.
> If you have a look into utimes, you see that Cygwin ignores this case:
> 
>   h = CreateFile()
>   if ((h == INVALID_HANDLE_VALUE)
>     if (win32.isdir ())
>       {
>         /* What we can do with directories more? */
> 	res = 0;
>       }
>     [...]
> 
> Can you add a __seterrno () before the `res = 0;' line and see what
> Win32 error is produced by CreateFile (*iff* my assumption is correct)?

No error is produced, so it is not the cygwin internals that are failing to 
touch directory times.  Opening a directory on either the ClearCase or the NFS 
mount point using CreateFile() generates a valid handle, and SetFileTimes 
returns 0 with GetLastError() returning 0; completely bypassing the win32.isdir
() check.  As far as I can tell, there is no way to detect that the 
SetFileTimes is a no-op on directories located in non-NTFS filesystems, short 
of reading the file times before and after the SetFileTimes call (which is not 
worth the effort).  Besides, detecting that SetFileTimes was a no-op is useless 
if there is no alternative way to force Windows to set the times on such a 
directory.




More information about the Cygwin-patches mailing list