[comp.sys.amiga.tech] ACTION_SET_DATE does not behave consistently

U211344@HNYKUN11.BITNET (Olaf 'Rhialto' Seibert) (01/20/89)

I recently played with setting the dates of files and directories
using the ACTION_SET_DATE packet (and the Old Filing System).
I noted the following (peculiar) behavior:

1. If the (in this case) directory of which you want to set the date,
   has a lock on it, like by doing an ASSIGN, ACTION_SET_DATE
fails to set the date. If, however, you change something IN that
same directory, the OFS has no problems changing the date of the
directory.

2. If point 1 does not apply, but the disk is write-protected,
   ACTION_SET_DATE *also* fails, *without* *putting* *up* *a*
*requester* (Volume xxx is write protected, retry/abort).

3. You really should be able to change the date of the root
   directory of a disk. The logical way to do this is giving a
lock on the root directory as parent directory lock (NULL
suffices on the boot disk, and maybe also on other disks),
and an empty name ("" converted to BPTR to BSTR). At least, this
is one way to get a directory listing of it! (CD SYS: LIST "")
Maybe the reason why this fails is because of point 1, but
maybe not.

The reason I found this is because I am writing a program that
displays the current date and time, asks the user for a new time
(and interprets incomplete answers intelligently), and sets both
the time in the system as well as on the system disk. In that
case, the next time you reboot you usually don't have to type
the full date.

The acceptable input as date and time is quite flexible:
you can give the date either as Www (a weekday), Dd[Mm[Yy[yy]]],
or Dd[Mmm[Yy[yy]]], where Mm is a numeric month and Mmm is
a 3 letter name for the month. All trailing components may be left
off. Also, if you only give a day number, and that is smaller
than the current day, the next month is assumed. Similar
for the months. So you only have to type the year if you don't
use your Ami for more than eleven months!

The time values accepted are h, hh, hmm, hhmm, hmmss, hhmmss.
Missing values default to zero.

You must always give the time, the date is optional.

[If enough interest is expressed, I'll send it to Bob.]

Freely_Distributable=Greetings(Not_For_Any_Commercial_Purpose)->
        Olaf.Seibert;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Q: How many lines does it take to screw in a disclaimer?     A: Only two.
 --- Olaf Rhialto Seibert the Marvellous --- U211344@hnykun11.bitnet ---
Study safely - stop deets     7167 BYTES FREE     Too painful to do right
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*