Vincent Béron vberon at
Thu May 9 10:17:08 CDT 2002

Insyde a écrit :
> >Actually, the flag can be cleared (usually by a backup program, for
> >incremental or differential backups). Now, I don't think (but could be
> >wrong) that this flag is still used actively, even by backup programs (a
> >database would probably be their best bet know, with a signature of the
> >file).
> >In Wine, the flag is only "set" when a program wants to know the
> >attributes of a file; elsewhere, the attribute is non existent. So I
> >guess it can stay that way.
> >Insyde, does the Archive flag is one of the differences you saw? BTW,
> >FAT32 or NTFS?
> >Bye,
> >Vincent
> Hi,


> Sorry for the late answer.
> My latest test, made this morning show some differences
> between W2K, W98 and Wine. The logs I have are:
> Wine:
> Target file is fff.c.
> The first file found is 1079340360
> The first alternate file found is 1079340620
> The first file attributes is 32
> The first file found creation is -1827365376
> The first file found last access is -1684948992
> The first file found last write is -1827365376
> The first file found (reserved0) is 0
> The first file found (reserved1) is 0
> The first file found size high is 0
> The first file found size low is 1631

So the creation and last write are the same...

The problem lies in FILE_FillInfo (files/file.c). In fact, the problem
lies in that Unix doesn't keep the creation time; instead, it keeps
(along with "last modification" and "last access") a "last change" time
(st_ctime), which reflects the last change to the inode of a file. Such
a change can include athe creation of the file, but also change to the
owner, permissions, etc., so it's not quite the same thing as the
creation time Windows expects. It _could_ be used, but then somebody
would have to check if the VFAT layer of Linux reads that time correctly
on a VFAT. And it won't necessarily give the same info as under Windows.

The included patch uses st_ctime for CreationTime, but I'm not sure it's
good. The right answer is "not easily doable".

> The first file found, first alternate are always different.
> Attributes, last write, last access, size hig and low are always the same.
> Reserved 0 and 1 just make sense in W2K, so, no problem ins here.
> (Or there is when running --winver nt(35/40/2k)?)
> Wine is mismatching the Creation, both w2k and w98 have the same.
> (I test with the same file in a floppy, so always the same.)

Sidenote: I thought floppies were FAT12, and I don't recall more than
one time stored in a FAT12 (or FAT16). But that was before Win95, so it
might have been extended to include such things, the same way long names
are held in more than a directory slot.

> This is the source of the program I run to make the tests, I get this from
> MSDN and add some to it:
> Hope this help you.
> Thanks,
> Ricardo.

-------------- next part --------------
--- files/file.c.orig	Thu May  9 10:55:51 2002
+++ files/file.c	Sun Apr 28 20:01:55 2002
@@ -659,7 +659,7 @@
     if (!(st->st_mode & S_IWUSR))
         info->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
-    RtlSecondsSince1970ToTime( st->st_mtime, &info->ftCreationTime );
+    RtlSecondsSince1970ToTime( st->st_ctime, &info->ftCreationTime );
     RtlSecondsSince1970ToTime( st->st_mtime, &info->ftLastWriteTime );
     RtlSecondsSince1970ToTime( st->st_atime, &info->ftLastAccessTime );

More information about the wine-devel mailing list