[Info-vax] DIR/DATE_FORMAT=DELTA ?
Marc Van Dyck
marc.gr.vandyck at invalid.skynet.be
Mon Jan 9 16:35:03 EST 2012
JF Mezei brought next idea :
> Kenneth Fairfield wrote:
>
>> But as others have said, it's a bit difficult to
>> see how DELTA time helps you,
>
>
> If <delta time> greater than X, then take some action.
>
> File not modified for X time, then archive it.
> File not backed up for X time, then do a backup.
>
> However, since such activities are more likely done in a command
> procedure, and command procedures can use f$file_attributes and then
> F$CVTIME, that functionality is already there.
I was about to say that.
The output of the DIRECTORY command is basically the result of a
F$SEARCH loop.
Asking for times in delta format probably means that this output
would get parsed afterwards for some kind of processing.
This is a bad habit and should not be done unless unavoidable. Over
the years, many lexical functions have been added to DCL in order
to avoid output parsing in most situations. Parsing output files in
DCL brings man back to Unix programming levels, a thing of the past ;-)
In this case, I would say - forget the DIRECTORY command, do your
own F$SEARCH loop, use F$FILE_ATTRIBUTES and F$CVTIME to produce
your list if you need so. And if the list was only needed to be
processed afterwards, forget about it completely and embed the
processing directly within the F$SEARCH loop itself.
--
Marc Van Dyck
More information about the Info-vax
mailing list