Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-unix!ctnews!pyramid!hplabs!sdcrdcf!ism780c!mikep From: mikep@ism780c.UUCP (Michael A. Petonic) Newsgroups: comp.unix.questions Subject: Re: How do I set a file's creation date? Message-ID: <6770@ism780c.UUCP> Date: Wed, 1-Jul-87 16:27:47 EDT Article-I.D.: ism780c.6770 Posted: Wed Jul 1 16:27:47 1987 Date-Received: Sat, 4-Jul-87 05:45:22 EDT References: <4280@caip.rutgers.edu> Reply-To: mikep@ism780c.UUCP (Michael A. Petonic) Organization: Interactive Systems Corp., Santa Monica CA Lines: 26 Keywords: ioctl's fcntl's ?? In article <4280@caip.rutgers.edu> brisco@caip.rutgers.edu (Thomas Paul Brisco) writes: > To test a program I'm trying to build a lot of files with >varying creation dates -- trouble is; I can't seem to find any >references to it. > I've checked all through the ioctl.h and fcntl.h as well as >file.h and haven't seen anything that pointed me in the right >direction. Does anyone have any idea how to go about this? First of all, you have to realize that what is show when you do an "ls -lc " is not the creating date. UNIX doesn't even store that despite what the user-level documentation says. It stores the last time that the i-node for the file was modified or created. Now, since the i-node contains info about the number of links, you could change the c-time of a file, merely by making a link to it and then removing the new link. This will give the original file the new c-time of whatever time it is. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The company and all my associates and friends and ESPECIALLY the government put me up to say all this useless trash. MikeP {seismo|sdcrdcf}!ism780c!mikep "Some of my best friends are Bigots..."