[comp.sys.atari.st] What does the read-only bit mean?

VBRANDT@DBNUAMA1.BITNET (12/05/89)

Hello all,

   What does the write-protect bit in the file attribute byte mean??

   As most of you know there is a bit in the attribute byte that indicates
READ-ONLY status when it's set.  This means that the file can't be written
to, can't be renamed or deleted.

   BUT: I can change the time/date entry with Fgsdatim() (or whatever the
GEMDOS function is called).  Is this a bug or a feature??  Or is it necessary
to enable the desktop to retain the time/date stamp while copying read-only
files?

   I can see advantages (for "make" type programs), but also some disadvan-
tages. Comments invited.

----------------------------------------------------------------------------
Bitnet:  VBRANDT@DBNUAMA1 (will go away some day ...)  Volker A. Brandt
          UNM409@DBNRHRZ1 (alternative)                Angewandte Mathematik
UUCP:    ...!unido!DBNUAMA1.bitnet!vbrandt             (Bonn, West Germany)
ARPAnet: VBRANDT%DBNUAMA1.BITNET@CUNYVM.CUNY.EDU

apratt@atari.UUCP (Allan Pratt) (12/06/89)

VBRANDT@DBNUAMA1.BITNET writes:
>   As most of you know there is a bit in the attribute byte that indicates
>READ-ONLY status when it's set.  This means that the file can't be written
>to, can't be renamed or deleted.
>   BUT: I can change the time/date entry with Fgsdatim() (or whatever the
>GEMDOS function is called).  Is this a bug or a feature??  Or is it necessary
>to enable the desktop to retain the time/date stamp while copying read-only
>files?

Well, here's the logic behind it: setting the read-only bit means you
can't change the DATA IN THE FILE.  You can still change the file's
directory entry, which includes its date and time.  This is necessary
because you must be able to change the file's attribute byte, also in
the directory.  If you couldn't do that, you couldn't ever
un-write-protect the file.

Alternatively, the answer is, "Because that's how Jason Loveman
implemented it."

It's not likely to change.

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt