Eric Blake <ebb9 <at> byu.net> writes: > > As I said above, I assume that MVFS has a problem similar to what we > > have for remote HPFS. It's not sufficient to set only the minimal > > set of access flags in calls to NtCreateFile/NtOpenFile in some > > circumstances. I can't tell where the problem is for cp -p since that > > shouldn't call anything different from touch in terms of setting timestamps. > > utimensat vs utimens?
Found the root cause. R/O vs. writeable. Doesn't matter where the source file lives; rather, the utimens call is failing because cp is changing the permissions to R/O prior to changing the times, all while keeping the same fd open that was used for populating the copy. But touch starts from a closed fd, which is enough of a different path to trigger the workaround path that temporarily removes the R/O bit to change the time and then turn the bit back on. Is that enough for you to go on, or do I need to also give strace details? $ echo hi > /tmp/bar $ touch -d yesterday /tmp/bar $ cp -p /tmp/bar bar1 $ chmod a-w /tmp/bar $ cp -p /tmp/bar bar2 $ ls -l bar? -rw-r--r-- 1 eblake Domain Users 3 Jul 16 17:12 bar1 -r--r--r-- 1 eblake Domain Users 3 Jul 17 17:12 bar2 -- Eric Blake -- 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