This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Corinna Vinschen <vinschen <at>> 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 (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 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]