[Linux-disciples] Changing the datestamp on a file

Ken Shan linux-disciples@bostoncoop.net
Tue, 7 Oct 2003 00:25:03 -0400


--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2003-10-07T00:16:31-0400, Stephen R Laniel wrote:
> I have a bunch of files named yyyy-mm-dd (year, month, day), created at
> various points over my blog's lifetime. I've edited those files over
> time, so the datestamps have changed; in some cases I've used sed to
> create entirely new files, so the creation date changed.
>=20
> So now I'd like to change the creation-date (or last-modified-date) stamp
> on all my files; if they're named yyyy-mm-dd, I'd like their date stamp
> to say that they were created on that date. Is such a thing possible?

Yes; check out the touch command or the utime function in Perl.

(By the way, what you called "creation date" is usually called
"modification date" or "mtime".)

--=20
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
"The first rule of politics: The ballots don't make the vote. The count
makes the vote." -- Boss Tweed in Gangs of New York

--LQksG6bCIzRHxTLp
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/gkAfzjAc4f+uuBURAmw1AKDRWBh7SpN1dILo+350hrSz4pjc9QCcDTY/
4jAn7KFbJUhXnuqQzOzidGo=
=I33r
-----END PGP SIGNATURE-----

--LQksG6bCIzRHxTLp--