Usenet comp.sys.vms (1990-2004)
 help / color / mirror / Atom feed
* Utility for chronological directories in DCL?
@ 1992-07-07 15:52 Naseer M. Khan
  1992-07-09  0:09 ` Jeff E. Nelson
  0 siblings, 1 reply; 2+ messages in thread
From: Naseer M. Khan @ 1992-07-07 15:52 UTC (permalink / raw)



Hi all,

	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...???!!!

	Any help will be greatly appreciated.  Thank you, in advance.


-- 
      |      |                        Signed:  Naseer Khan
      | (~)(o)                                 ___________
     C      _)                               
      | ,___|				       khan@us17501.mdc.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Utility for chronological directories in DCL?
  1992-07-07 15:52 Utility for chronological directories in DCL? Naseer M. Khan
@ 1992-07-09  0:09 ` Jeff E. Nelson
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff E. Nelson @ 1992-07-09  0:09 UTC (permalink / raw)



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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1992-07-09  0:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1992-07-07 15:52 Utility for chronological directories in DCL? Naseer M. Khan
1992-07-09  0:09 ` Jeff E. Nelson

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