Lets assume today is 26.9.2003 (26th of September 2003).
The original file in WindowsXP has the following
Now, I copy that file inside WindowsXP to another
folder. E.g. from C:\ to C:\TEMP and it will get
the following values:
Notice how the created field changes.
Now again I take the original file and copy it
via samba to linux (redhat 9):
How come the created date is in the past? If I try
to think logically then isn't it so that when I copy
file to linux via samba, a new file is created? And
when new file is created then isn't it logical that the
creation date is today and not in the past?
Using the modified date affects at least some backup scripts.
E.g. You have a backup script to take incremental backup
of all the files which have changed since the last backup.
If the last backup time was 25th of Semptemer then it will
look for files which are newer than 25th of Semptember and
of course it doesn't backup any files which are copied to
linux via samba because their date is in the past.
I'm not sure that this is a "bug". It really depends how
you see things. I tried to look into smb.conf values, but
I couldn't find anything that would allow me to change
posix doersn't store the creation time. This is one of
the differences between posix and NTFS file system semantics.
So smbd has to fake the creation date based on one of the other
timestamp values (see the stat man page for details).
Yes, I understand posix doesn't support creation time.
I am just wondering why smbd uses the modified time
and not current date? I don't see the logic behind
that solution. E.g.
If you have file foo.txt:
Sep 29 09:01 foo.txt
Now you say "cp foo.txt bar.txt" it becomes:
0 Sep 29 09:02 bar.txt
So when file is copied (inside linux or windows) the
creation/modification date is the current date. I think
we can agree on that :).
But samba doesn't work like that. Even though new file
is created, it uses the modified date information. If today
is 1st of Semptember 2003 then the file in windows might
have it's modified time 1st of January 2003. Now when that
file is copied to linux via samba, samba uses that modified
information. In my opinion linux and windows use the same
logic, but samba does not. That is why I first reported
Is there some reason you cannot use the current date when
file is copied to windows? If this is not considered as
a bug, maybe this could be added as feature request. Maybe
parameter in smb.conf to define whether to use the modified
timestamp or use current timestamp.