Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: jweiss@casbah.acns.nwu.edu (Jerry Weiss)
Subject: Re: Attn RT-11 gurus: file protect detection?
Date: Fri, 7 Feb 1992 20:24:23 GMT	[thread overview]
Message-ID: <1992Feb7.202423.26769@casbah.acns.nwu.edu> (raw)
In-Reply-To: 1992Feb6.104432.1599@vixvax.mgi.com

In article <1992Feb6.104432.1599@vixvax.mgi.com> cepek@vixvax.mgi.com writes:
>On RT-11, is there a way to find out if a file is protected (without
>having to muddle through the directory itself)?
>
>There don't seem to be any system requests for such a seemingly
>simple task; none of these seem to help:  .CSTAT, .DSTATUS, .ENTER,
>.LOOKUP, .PURGE, .RENAME, etc.
>
>Note that I don't want to _change_ the protection (that's easy with
>.FPROT), I want to find out what it currently is for a file.
>
>In fact, the documentation says that you can do a .LOOKUP on a
>file that is protected and then write to it (honest! look up .FPROT).
>So how the heck am I supposed to know that I _shouldn't_ change
>the file because it is protected?  KEX does it:
>   ?KEX-W-Output file or device protected- Inspect (Y,N) ? _
>
>(At this point, I'd even be willing to entertain something undocumented.)

RT-11 file protection is intended only to ensure that a file is not
deleted accidently.  You can overwrite the file at will.   I don't believe
you can just test the file protection status.  I suspect KED/KEX does
something unethical like look directly at the directory.  You can
get the directory segment from .CSTAT and look yourself w/o searching the
entire directory.   I'm not aware of any other method.

  Of course if you do a .ENTER first it will report failure if protected.
Then you can .Purge I suppose if you really wanted to keep the unprotected
file.  I have not tried this however.





-- 
Jerry S. Weiss	  "If you can't stand the heat, stay out of the antimatter!"
j-weiss@nwu.edu    Dept. Medicine, Northwestern Univ. Medical School


      parent reply	other threads:[~1992-02-07 20:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-02-06 15:44 Attn RT-11 gurus: file protect detection? cepek
1992-02-07  1:02 ` cepek
1992-02-07 18:16   ` Soln: Attn RT-11 gurus: file protect detection cepek
1992-02-13 16:51     ` John M. Crowell
1992-02-07 20:24 ` Jerry Weiss [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox