home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
392.lha
/
ReDate_v1.1
/
ReDate.docs
< prev
next >
Wrap
Text File
|
1990-07-03
|
3KB
|
49 lines
REDATE <directory name> V1.1 April 6/1990 Jim Butterfield
------ ----------------
COPY ALL CLONE is a wonderful way of repacking a disk,
copying a drawer, or transferring to hard disk. BUT .. it copies
only files, not directories, which are [.. created]. This means
that the directories get TODAY as their date, rather than the
date of the originally copied directory.
LIST should tell me what's old stuff and what's new.
But for DIRs, the dates usually mislead on copied disks.
* * * * * * * * *
REDATE DF0: datestamps each subdirectory to a date
matching its most recent contents. Empty subdirectories will
date to 01-Apr-78. REDATE does all directory levels, from
the bottom up to (not including) the specified level.
Any directory may be specified. The basic intent is to
handle root directories (DF0:, RAM:, RAD:, Workbench:) but it
will work happily on any directory (FONTS:, DF0:DEVS, RAM:T).
The NAMED directory will not be datestamped; in the case of a
root directory, it can't be, and in other cases it would make
the coding less readable. So REDATE DF0:DEVS will datestamp
DEVS/PRINTERS and DEVS/KEYMAPS but not DF0:DEVS itself.
....info files are ignored in terms of date information.
The idea here is that such files are re-dated by such simple
manipulations as moving an icon or resizing a window. Their
dates, carried up to the enclosing drawer, would mislead.
* * * * * * * * *
Coding notes: the program is PURE, but does anyone care when it's
less than 2K in size?
SetFileDate does not exist as a DOS command, so a packet
structure must be built and sent to DOS. That's more work than
usual, since a BSTR must be constructed of each subdirectory
name, and two message ports are involved: the one you send to,
and the one on which you receive a reply. The first must be
"found" with DeviceProc; the second could be taken from the current
process, but here is constructed (cf Sheppner, "New Packets...").
For this last, CreatePort (usually taken from amiga.lib) has
been replaced by more organic code which fits in-line. In fact,
the MessagePort, Message, DosPacket, and BSTR work area are all
tucked cozily together in a 216-byte block.
Coding has to be carefully recursive to allow scanning to any
depth of subdirectory. Variable LEVEL is not needed, but is there
in case you want to work further on the code.
Note that this program supplies a RETURN code level, so that
scripts may test whether things worked as hoped.
--Jim B