From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,dbe6b8f0f831d25 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1992-02-07 13:13:34 PST Newsgroups: comp.sys.dec Path: sparky!uunet!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!jweiss From: jweiss@casbah.acns.nwu.edu (Jerry Weiss) Subject: Re: Attn RT-11 gurus: file protect detection? Message-ID: <1992Feb7.202423.26769@casbah.acns.nwu.edu> Organization: Northwestern University, Evanston, Illinois References: <1992Feb6.104432.1599@vixvax.mgi.com> Date: Fri, 7 Feb 1992 20:24:23 GMT 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