[comp.sys.amiga.misc] What does the r protection bit do anyway?

gerber@sirius.astro.uiuc.edu (Richard Gerber) (05/17/91)

Hi all,
What does the 'r' protection bit under AmigaDOS do? I thought it 
would prohibit read access, but it appears to have no affect on
anything.
In fact all these bits seem a bit screwy to me. I played around
with text files, I set various bits then tried to edit the file
with ed, and here's what I found:
(1) Can I read the file into ed?
(2) Can I save changes made in ed?
(3) Can I delete the file?
(4) Final status after trying to save in ed.

Original		(1)	(2)	(3)      (4)	
status     Filename				

----rwed   Textfile	YES	YES 	YES	----rwed
-----wed   Textfile	YES	YES	YES	----rwed	
----r-ed   Textfile	YES	YES	YES	----rwed
----rwe-   Textfile	YES	NO	NO	----rwe-
-------d   Textfile	YES	YES	YES	----rwed
--------   Textfile	YES	NO	NO	--------
----r--d   Textfile	YES	YES	YES	----rwed
i

So it appears that the only thing that has any effect is the 'd' bit.

Even worse, the program Stevie lets me edit and save changes with all
protection bits turned off. (It does keep a copy of the original in
filename.bak, however.)

So am I just missing something here? How do these things work? 

Regards,
Richard
gerber@rigel.astro.uiuc.edu

alex@bilver.uucp (Alex Matulich) (05/21/91)

In article <1991May17.133831.2388@ux1.cso.uiuc.edu> gerber@sirius.astro.uiuc.edu (Richard Gerber) writes:
>What does the 'r' protection bit under AmigaDOS do? I thought it 
>would prohibit read access, but it appears to have no affect on
>anything.
[stuff deleted]
>So it appears that the only thing that has any effect is the 'd' bit.

As I understand it, you are correct.  The alternative shell WShell,
however, is not as loose about the protection bits.  If a file does not
have "e" set, the it's not an executable.  If a file doesn't have "w" set,
you can't write to it.

I see no point, in a single user OS, for read-protection.  What use is a
write-only file?

-- 
 _ |__  Alex Matulich
 /(+__>  Unicorn Research Corp, 4621 N Landmark Dr, Orlando, FL 32817
//| \     UUCP:  alex@bilver.uucp   <or>  ...uunet!tarpit!bilver!alex
///__)     bitnet:  IN%"bilver!alex@uunet.uu.net"