This is the mail archive of the cygwin 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: file times still not quite right with 1.5.14 on Windows 98


Eric Blake wrote:
I wrote:
Only the ctime has changed, the mtime (which make looks at) hasn't.
In fact, the ctime shouldn't have changed, because it's creation
time on Windows.

The change in cygwin 1.5.13 to make ctime track change-time and not creation-time was intentional. Yes, this is different from the default Window's behavior, but cygwin is trying to provide a POSIX environment, not a windows environment, and POSIX requires ctime to stand for change time.

The bug is not that ctime was touched, but that mtime was not
touched.  Normally, Windows updates mtime automatically if you edit a
file, only the ctime needed special treatment from cygwin.  I have no
idea why Win98 is not touching the mtime on appending or truncation.

Oh, I have no problem with ctime changing, but mtime not changing is
definitely a bug in cygwin. It must somehow intentionally copy the old
mtime when a file is modified. If I repeat the sequence I posted using DOS tools instead of cygwin to modify the file, the mtime is updated correctly:


D:\>bash
BASH-2.05b$ date
Sun Apr  3 15:43:12 EDT 2005
BASH-2.05b$ ls -l versiond.h
-rw-r--r--  1 Josef Josef 13 Apr  3 14:16 versiond.h
BASH-2.05b$ ls -l --time=ctime versiond.h
-rw-r--r--  1 Josef Josef 13 Apr  3 14:16 versiond.h
BASH-2.05b$ exit
exit

D:\>echo >> versiond.h

D:\>bash
BASH-2.05b$ ls -l versiond.h
-rw-r--r--  1 Josef Josef 25 Apr  3 15:43 versiond.h
BASH-2.05b$ ls -l --time=ctime versiond.h
-rw-r--r--  1 Josef Josef 25 Apr  3 14:16 versiond.h

Now the mtime is correctly updated, which it isn't when using bash's echo builtin.

I can only guess that when cygwin is changing the ctime, it first reads the old mtime and preserves it instead of changing it as well. But I've never looked at the cygwin internals so I don't know what's happening in detail, although I'll be happy to help with the debugging, given some pointers in where to look.

--
   Josef Drexler                 |       http://jdrexler.com/home/
---------------------------------+----------------------------------------
 Please help Conserve Gravity    |  Email address is *valid*.
 Play Chess, not Basketball.     |  Don't remove the "nospam" part.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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