Usenet comp.sys.vms (1990-2004)
 help / color / mirror / Atom feed
From: jnelson@gauche.zko.dec.com (Jeff E. Nelson)
Subject: Re: Utility for chronological directories in DCL?
Date: Thu, 9 Jul 1992 00:09:23 GMT	[thread overview]
Message-ID: <1992Jul9.000923.23483@nntpd.lkg.dec.com> (raw)
In-Reply-To: 1992Jul7.155237.1153@usenet.ins.cwru.edu


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


      reply	other threads:[~1992-07-09  0:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-07-07 15:52 Utility for chronological directories in DCL? Naseer M. Khan
1992-07-09  0:09 ` Jeff E. Nelson [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox