From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,5847d02cd7fdd958 X-Google-Attributes: gid1164f8,public X-Google-Thread: fc7fa,5847d02cd7fdd958 X-Google-Attributes: gidfc7fa,public X-Google-ArrivalTime: 1992-07-08 11:46:50 PST Xref: sparky comp.sys.vms:13 comp.sys.dec:3940 Newsgroups: comp.sys.vms,comp.sys.dec Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!gauche.zko.dec.com!jnelson From: jnelson@gauche.zko.dec.com (Jeff E. Nelson) Subject: Re: Utility for chronological directories in DCL? Message-ID: <1992Jul9.000923.23483@nntpd.lkg.dec.com> Sender: usenet@nntpd.lkg.dec.com (USENET News System) Reply-To: jnelson@gauche.zko.dec.com (Jeff E. Nelson) Organization: Digital Equipment Corporation References: <1992Jul7.155237.1153@usenet.ins.cwru.edu> Date: Thu, 9 Jul 1992 00:09:23 GMT In article <1992Jul7.155237.1153@usenet.ins.cwru.edu>, bc994@cleveland.Freenet.Edu (Naseer M. Khan) writes: |> I am looking for a DCL utility that would produce a file directory in |>chronological order, something akin to the "ls -lt" command in Unix. |>I have tried the SORT command already but I run into trouble trying to |>sort the month field. Why the heck didn't they put the month names in |>alphabetical order anyways...???!!! Use the F$FILE_ATTRIBUTES lexical (HELP LEXICAL F$FILE_ATTRIBUTES) to get the file modification date, then use F$CVTIME to convert the date to a format more agreeable to sorting. I recommend something like this: $ file_name="login.com" $ file_modification_date = f$file_attributes(file_name,"rdt") $ sortable_date = f$cvtime(file_modification_date,"comparison") $ write sys$output sortable_date, " ", file_name Obviously, you'll want to write this info into a temporary file, and then SORT it. You'll get something like: 1992-07-08 20:07:59.23 login.com Hope this helps. -Jeff E. Nelson -Digital Equipment Corporation -Internet: jnelson@gauche.zko.dec.com -Affiliation given for identification purposes only