From owner-freebsd-hackers Thu May 25 7: 8: 4 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from gekko.i-clue.de (server.ms-agentur.de [62.153.134.194]) by hub.freebsd.org (Postfix) with ESMTP id EC21F37C1FF for ; Thu, 25 May 2000 07:07:53 -0700 (PDT) (envelope-from so@server.i-clue.de) Received: from i-clue.de (automatix.i-clue.de [192.168.0.112]) by gekko.i-clue.de (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA22553; Thu, 25 May 2000 18:10:04 +0200 Message-ID: <392D33C5.D8C19205@i-clue.de> Date: Thu, 25 May 2000 16:08:06 +0200 From: Christoph Sold Organization: i-clue interactive GmbH X-Mailer: Mozilla 4.72 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Don Lewis Cc: Arun Sharma , Peter Jeremy , hackers@FreeBSD.ORG Subject: Re: file creation times ? References: <00May25.110340est.115250@border.alcanet.com.au> <20000524185859.A19573@sharmas.dhs.org> <200005250932.CAA20546@salsa.gv.tsc.tdk.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Don Lewis wrote: > On May 24, 6:58pm, Arun Sharma wrote: > } Subject: Re: file creation times ? > } On Thu, May 25, 2000 at 11:03:38AM +1000, Peter Jeremy wrote: > } > To put it another way, why _should_ FreeBSD store a file creation time? > } > } 0. I'm tired of seeing people putting "Created: mm/dd/yy" in their documents. > > When saving a document to "file", many editors will do the equivalent of > save document to "file.new" > ln "file" "file.bak" > mv "file.new" "file" > in order to minimize the possibility of losing the document if the editor > or the system crashes at just the wrong time. The result of this would > be to set the file creation time to the time it was last saved. This > won't be very helpful if you are relying on the file creation time to > tell you when the *document* was first created. To answer the question who needs this: Apple Macintosh MFS filesystems (long died since the MacPlus) introduced the file creation date, and it lives on since then in Apples HFS and HFS+ Filesystems. I found the information handy when searching for files. [snippety] > What should the semantics of the creation time be across a backup and > restore? Should the original creation time be restored, or should the > creation time be the time when the restored copy of the file is written? > What about just copying a file? If I make an exact copy of a document, > should the two copies have the same or differing creation times? To solve these questions (along with the one shown above in code), Apple has a "Swap File Info" call. This way, read document; save document to file.tmp; [work on the document, saving to the tempfile as you whish] [when the user say to save now:] save document to file.tmp; exchange file info records of file.tmp and document; {optionally rename file.tmp to document.bak -- remember, file info was swapped before} Now everything else is easy: after a backup, the file creation time is the time the file was originally created (not the restored copy's creation time). A copied file is created when you copy it. Exact copies should have different creation times. That's the way HFS does it -- other opinions welcome. I like it this way. If somebody can dream up an implementation in FFS, I'd love to see it realized (and have some good use for it, since I tend to remember when something started...). Hope this clarifies the topic a little -Christoph Sold To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message