Article View: comp.lang.misc
Article #952trivial portability (was: Relationship between C and C++)
From: David Vinayak Wallace
Date: Thu, 22 Mar 1990 21:47
Date: Thu, 22 Mar 1990 21:47
18 lines
1548 bytes
1548 bytes
Date: 22 Mar 90 18:55:53 GMT
From: adrian@mti.mti.com (Adrian McCarthy)
Exercise for the reader: write a *portable* program in any language which
takes a file name as its parameter and returns the modification or creation
date and time of that file. Don't use any conditional compilation.
Took longer to trim your message above than it took me to write the
code below (in common lisp):
(defun demo ()
(format "~&Enter pathname to examine: ")
(let ((pathname (pathname (readline))))
(multiple-value-bind (second minute hour day month year)
(decode-universal-time (file-write-date pathname))
(format "The file was written by ~a; on ~D-~D-~D at ~D:~D:~D"
(file-author pathname) day month year hour minute second))))
Technical Details
Message-ID:
<GUMBY.90Mar22134720@Gang-of-Four.Stanford.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!samsung!usc!snorkelwacker!apple!bionet!ames!eos!shelby!neon!neon!gumbyReferences:
<EGB2327xds13@ficc.uu.net> <8432@hubcap.clemson.edu> <6515@eos.UUCP> <2944@castle.ed.ac.uk> <D_D27L1xds13@ficc.uu.net> <970@mti.mti.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!samsung!usc!snorkelwacker!apple!bionet!ames!eos!shelby!neon!neon!gumby From: gumby@Gang-of-Four.Stanford.EDU (David Vinayak Wallace) Newsgroups: comp.lang.misc Subject: trivial portability (was: Relationship between C and C++) Keywords: portability myth lisp Message-ID: <GUMBY.90Mar22134720@Gang-of-Four.Stanford.EDU> Date: 22 Mar 90 21:47:20 GMT References: <EGB2327xds13@ficc.uu.net> <8432@hubcap.clemson.edu> <6515@eos.UUCP> <2944@castle.ed.ac.uk> <D_D27L1xds13@ficc.uu.net> <970@mti.mti.com> Sender: news@Neon.Stanford.EDU (USENET News System) Organization: Computer Science Department, Stanford University Lines: 18 In-Reply-To: adrian@mti.mti.com's message of 22 Mar 90 18:55:53 GMT