From: cepek@vixvax.mgi.com
Subject: Soln: Attn RT-11 gurus: file protect detection
Date: 7 Feb 92 13:16:45 CDT [thread overview]
Message-ID: <1992Feb7.131645.1612@vixvax.mgi.com> (raw)
In-Reply-To: 1992Feb6.200201.1602@vixvax.mgi.com
> In article <1992Feb6.104432.1599@vixvax.mgi.com>, I wrote:
> On RT-11, is there a way to find out if a file is protected (without
> having to muddle through the directory itself)?
> :
I've found something that works. First do a .ENTER for the file. This
attempts to create a tentative entry in the directory for the (new)
file. It will fail if a protected file by that name already exists.
So far so good.
If the file doesn't exist already, or does exist but is not protected,
the .ENTER will succeed (barring other errors). If this file (channel)
is then closed, the original file will be replaced with the new, empty
one - this would be bad. So instead free up the channel with a .PURGE
request. This abandons the tentative directory entry, leaving
everything else alone. Viola.
And best of all I can do it from C, by using a recent creation of mine -
a C-callable EMT utility routine for EMT 374 and EMT 375 calls. Most
RTLs have them, I know, but they also have a bug which zaps the high-bit
of the return value for error indication, which screws up quite a few
I/O requests expecting to be able to return unsigned ints. (Mine also
returns the error byte as well as R0).
Fare thee well.
,--------------------------------,___________________________
/ Mike Cepek, Sr. Software Eng. / Internet: CEPEK@MGI.COM /
\ Management Graphics, Inc. \ Voice: +1 612/851-6112 \ "Make
/ 1401 East 79th Street / Operator: +1 612/854-1220 / it so."
\ Minneapolis, MN 55425 USA \ Fax: +1 612/854-6913 \
`-------------------------------/___________________________/
next prev parent reply other threads:[~1992-02-07 18:16 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 ` cepek [this message]
1992-02-13 16:51 ` Soln: Attn RT-11 gurus: file protect detection John M. Crowell
1992-02-07 20:24 ` Attn RT-11 gurus: file protect detection? Jerry Weiss
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