Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

keep original file creation date from changing

22 views
Skip to first unread message

Michael Hearne

unread,
Jan 13, 2005, 12:58:27 AM1/13/05
to
Hello,
I am downloading historical programming language files to save to cdrom.
Whenever I download a set of files from whatever source, the downloaded
files have their creation dates reset to the present date. I need to
keep the original file creation dates.

I have Googled for it, but all I seem to find are methods to
intentionally change, rather than preserve the file creation dates.

I am using Mandrake 10.1, but I have also noticed the same behavior on
Windows 2000. I don't really care if this happens with saved web pages,
but with binaries, and original documents, I need to keep the original
dates. Otherwise, I have to take a lot of time to determine the version
of each file.

I don't have time to write down the file date at download time, and then
return and touch each file, there are way too many of them.

On Windows, using WS_FTP, I can set the program to keep the original
file dates, but not all are available via ftp. Using IE or Mozilla, the
change seems to be automatic, and I do not see a control.

Anyone know how I can prevent the file creation dates from being changed
on downloaded files?

Thanks,

Michael


--
RLU #352695
35.14N - 101.50W

Chris F.A. Johnson

unread,
Jan 13, 2005, 1:16:50 AM1/13/05
to

Try wget.

--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License

Michael Hearne

unread,
Jan 14, 2005, 1:00:49 AM1/14/05
to
Chris F.A. Johnson wrote:
> On Thu, 13 Jan 2005 at 05:58 GMT, Michael Hearne wrote:
>
>>Hello,
>>I am downloading historical programming language files to save to cdrom.
>>Whenever I download a set of files from whatever source, the downloaded
>>files have their creation dates reset to the present date. I need to
>>keep the original file creation dates.
>>
> <snip>
>
> Try wget.
>

Hi Chris,
I've used your pages in the past, and I know that I can literally do
anything from the cli. How would I do this from a graphical web page?
Should I log on to a site using an interface like lynx? I don't see how
I could open a shell in Mozilla.

I realize that updating the file dates is critical to things like using
cpio to synchronize directories, that's how I keep my Linux and Windows
documents in sync. But if a file was created in 1995 or 1987, and I need
to keep that date, then I wish I had an easy option.

I'll try logging on to one of these sites using lynx and let you know
how it worked.

Lew Pitcher

unread,
Jan 14, 2005, 8:05:43 AM1/14/05
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Hearne wrote:
> Hello,
> I am downloading historical programming language files to save to cdrom.
> Whenever I download a set of files from whatever source, the downloaded
> files have their creation dates reset to the present date. I need to
> keep the original file creation dates.

Linux does not record or preserve a "file creation date"; there is no
way to preserve such a date within the filesystem metadata.

> I have Googled for it, but all I seem to find are methods to
> intentionally change, rather than preserve the file creation dates.

See above.

> I am using Mandrake 10.1, but I have also noticed the same behavior on
> Windows 2000.

Win2K (and any other MSWindows product) keeps different file metadata
than Linux does. IIRC, MSWindows keeps a "file creation date", so if you
have a problem with Win2K, it's likely a user-operation issue rather
than a system-implementation issue.

> I don't really care if this happens with saved web pages,
> but with binaries, and original documents, I need to keep the original
> dates. Otherwise, I have to take a lot of time to determine the version
> of each file.

Have you tried keeping this information manually? Say, in a file that
lists filenames and "original creation" dates?

> I don't have time to write down the file date at download time, and then
> return and touch each file, there are way too many of them.

Sorry, but it looks like you're going to have to exactly that.

> On Windows, using WS_FTP, I can set the program to keep the original
> file dates, but not all are available via ftp. Using IE or Mozilla, the
> change seems to be automatic, and I do not see a control.

That's on MSWindows, which is a completely different OS. Your statement
is like saying that, in the USA, you can drive on the right side of the
road, so you should be able to drive on the right side of the road in
England as well.

> Anyone know how I can prevent the file creation dates from being changed
> on downloaded files?

Not possible. File creation isn't recorded anywhere, so it neither
changes nor is shown.

> Thanks,
>
> Michael
>
>


- --

Lew Pitcher, IT Consultant, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFB58OlagVFX4UWr64RAkTYAKDEkGk43DFbZ8i10CmRVmGQlYCcdACgxL4V
7KAk6mAAQw4bXwhRmoJJ0ZI=
=2V6u
-----END PGP SIGNATURE-----

Lew Pitcher

unread,
Jan 14, 2005, 8:11:31 AM1/14/05
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lew Pitcher wrote:
> Michael Hearne wrote:
>
>>>Hello,
>>>I am downloading historical programming language files to save to cdrom.
>>>Whenever I download a set of files from whatever source, the downloaded
>>>files have their creation dates reset to the present date. I need to
>>>keep the original file creation dates.
>
>
> Linux does not record or preserve a "file creation date"; there is no
> way to preserve such a date within the filesystem metadata.

FWIW, Linux does place three different timestamps on each file and it's
up to the filesystem to physically record these timestamps. Some
filesystems, like MSDOS and VFAT do not have the physical facilities to
record the Linux fs timestamp information, making retrieval of the
appropriate timestamp problematic.

In any case, here (courtesy of the 'stat(2) manpage) are the timestamps
that you have access to:

The field st_atime is changed by file accesses, e.g. by
execve(2), mknod(2), pipe(2), utime(2) and read(2) (of
more than zero bytes). Other routines, like mmap(2), may
or may not update st_atime.

The field st_mtime is changed by file modifications, e.g.
by mknod(2), truncate(2), utime(2) and write(2) (of more
than zero bytes). Moreover, st_mtime of a directory is
changed by the creation or deletion of files in that
directory. The st_mtime field is not changed for changes
in owner, group, hard link count, or mode.

The field st_ctime is changed by writing or by setting
inode information (i.e., owner, group, link count, mode,
etc.).

All three timestamps are initially set to the to the same value when the
file is created, and are changed independantly as the file is accessed.

- --

Lew Pitcher, IT Consultant, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFB58UBagVFX4UWr64RAglwAKDQMGB04TMpIUmRCht9XizAEPR0XwCgx5KZ
y/s57Jy072hU75hbg70fiT0=
=ZZiQ
-----END PGP SIGNATURE-----

Michael Hearne

unread,
Jan 15, 2005, 1:16:31 AM1/15/05
to

OK, if I understand it correctly, when I download a file, it becomes a
new file (on my machine) and therefore gets a new creation date. I'll
spend some time on the manpages and see what I can learn. I'll probably
head over to comp.unix.shell and lurk there for a while as well.

Thank you,

Rouben Rostamian

unread,
Jan 15, 2005, 2:00:47 AM1/15/05
to
In article <3z2Gd.7280$pZ4...@newsread1.news.pas.earthlink.net>,

Michael Hearne <he...@home.us> wrote:
>OK, if I understand it correctly, when I download a file, it becomes a
>new file (on my machine) and therefore gets a new creation date. I'll
>spend some time on the manpages and see what I can learn. I'll probably
>head over to comp.unix.shell and lurk there for a while as well.

As Chris Johnson said, use wget. It preserves the original
file's timestamp.

Example:

wget http://www.gnu.org/philosophy/free-sw.html


--
Rouben Rostamian

Lew Pitcher

unread,
Jan 15, 2005, 10:09:03 AM1/15/05
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Hearne wrote:
> Lew Pitcher wrote:
[snip]


>>>> Linux does not record or preserve a "file creation date"; there is no
>>>> way to preserve such a date within the filesystem metadata.
>>
>> FWIW, Linux does place three different timestamps on each file and it's
>> up to the filesystem to physically record these timestamps.

[snip]


>> The field st_atime is changed by file accesses, e.g. by
>> execve(2), mknod(2), pipe(2), utime(2) and read(2) (of
>> more than zero bytes). Other routines, like mmap(2), may
>> or may not update st_atime.
>>
>> The field st_mtime is changed by file modifications, e.g.
>> by mknod(2), truncate(2), utime(2) and write(2) (of more
>> than zero bytes). Moreover, st_mtime of a directory is
>> changed by the creation or deletion of files in that
>> directory. The st_mtime field is not changed for changes
>> in owner, group, hard link count, or mode.
>>
>> The field st_ctime is changed by writing or by setting
>> inode information (i.e., owner, group, link count, mode,
>> etc.).
>>
>> All three timestamps are initially set to the to the same value when the
>> file is created, and are changed independantly as the file is accessed.
>>
>
> OK, if I understand it correctly, when I download a file, it becomes a
> new file (on my machine) and therefore gets a new creation date.

Not quite.

When you download a file, it becomes a new file (on your machine) and therefore
gets
- a new last_file_access time (atime),
- a new last_file_modification time (mtime), and
- a new last_inode_modification time (ctime)
The file does /not/ get a new creation date; there /is no/ creation date.

Once the file is on your system,
- - if you browse the file, the last_file_access time changes with each browse
- - if you edit the file, the last_file_modification time changes with each edit,
- - if you change the file's attributes, the last_inode_modification time changes
with each attribute change
The 'creation date' is not preserved; there /is no/ creation date.

> I'll
> spend some time on the manpages and see what I can learn. I'll probably
> head over to comp.unix.shell and lurk there for a while as well.

That's a good idea. comp.unix.shell is an interesting and active group.

> Thank you,

You're welcome

> Michael
>


- --
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB6TIPagVFX4UWr64RAtSkAJ9ocWUJ3+oLeoTW+l7c7ksUcFKafwCfTdP3
7hSfaWSE8p2fArUMaqczFDE=
=H9uN
-----END PGP SIGNATURE-----

0 new messages