237B SetFileAccess¶
Stub MON 237B (159 decimal) · Mnemonic SFACC · Group: File Operations (manual section 2.4)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_237B_SetFileAccess.c
Description¶
Sets the access protection for a file. You should specify the access for yourself, friends, and other users. The default file access for yourself is full access. Your friends have read access only. Other users have no access.
- You need directory access to a file to change the file access. User SYSTEM and RT may set the access protection for any files.
- Use the characters R, W, A, C, D, and N to specify the legal file access. R means Read. W means Write. A means Append to the end of a file. C means Common, i.e. more than one user may access the file at a time. D means Directory access, i.e. the file may be deleted, new versions created, etc. N means No access.
- Use @FILE-STATISTICS to check the file access.
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
FileName |
STRING | In | File name. It is most efficient to use unabbreviated file names, e.g. EXAMPLE:TEXT. The default file type is :SYMB. |
PublicAccess |
STRING | In | Public access. Use N or a combination of R, W, A, C, and D. Public access is typically set to R or N. |
FriendAccess |
STRING | In | Friend access. Use N or a combination of R, W, A, C, and D. Friend access is typically set to RWA or R. |
OwnAccess |
STRING | In | Own access. Use N or a combination of R, W, A, C, and D. Own access is typically RWACD, though lesser combinations can be used (e.g. RWAC to protect your own files from accidental deletion by yourself). |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
CreateFriend, SetObjectEntry, @SET-FILE-ACCESS, and @SET-DEFAULT-FILE-ACCESS
Compatibility¶
| Machines | Users | Programs |
|---|---|---|
| ND-100 and ND-500 | All users | All programs |
The manual's compatibility box for this call, word for word.
Yes/no fields from the YAML extraction (not in the manual's words):
| ND-100 | ND-500 | User programs | RT programs | System programs |
|---|---|---|---|---|
| Yes | Yes | Yes | Yes | No |
Examples¶
From the manual (OCR text, not corrected).
BYTES : FileName(0:63), PubAccess(0:5), FriendAccess(0:5), OwnAccess(0:5)
...
ON ROUTINEERROR DO
IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('SetFileAccess', FileName, PubAccess, FriendAccess, OwnAccess)
CHARACTER FileName*64, PubAcc*5, FriendAcc*5, OwnAcc*5
...
Monitor_Call('SetFileAccess', FileName(1:64), PubAcc(1:5),
FriendAcc(1:5), OwnAcc(1:5))
IF (ErrCode .NE. 0) THEN ...
Scanned by Jonny Oddene for Sintran Data © 2020
FileName : PACKED ARRAY [0..63] OF CHAR;
PubAccess, FriendAccess, OwnAccess : PACKED ARRAY [0..4] OF CHAR;
...
SetFileAccess(FileName, PubAccess, FriendAccess, OwnAccess);
IF ErrCode <> 0 THEN ...
01 FileName PIC X(64).
01 PubAcc PIC X(5).
01 FriendAcc PIC X(5).
01 OwnAcc PIC X(5).
01 ErrCode COMP.
...
MONITOR-CALL "SetFileAccess" USING FileName, PubAcc, FriendAcc, OwnAcc.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
FileName : STRINGDATA 'EXAMPLE:SYMB''' %Set access of file EXAMPLE:SYMB to
PubAccess : STRINGDATA 'N''' % no public access
FriendAccess : STRINGDATA 'RA''' % read, append access for friends
OwnAccess : STRINGDATA 'RWACD''' % full own access
ErrCode : W BLOCK 1
SetFileAccess : EQU 37B9 + 237B
...
CALLG SetFileAccess, 4, FileName, PubAccess, FriendAccess, OwnAccess
IF K GO ERROR
...
ERROR : W1 =: ErrCode %ErrorCode in W1 register.
LDX (FILE %Address of string with file name.
LDT (PUBAC %Address of string with public access characters.
LDA (FRIAC %Address of string with own access characters.
COPY SA DD
LDA (OWNAC %Address of string with friend access characters.
MON 237 %Monitor call SetFileAccess.
JMP ERROR %Error return from monitor call.
... %Normal return.
ERROR, ... %Error number in register A.
...
FILE, 'EXAMPLE:SYMB' %Change access for EXAMPLE:SYMB.
PUBAC, 'N' %No public access.
FRIAC, 'RA' %Read write append access for friend.
OWNAC, 'RWACD' %Full own access.
ndmonlib implementation¶
Stub Registered MON_STATUS_NOT_IMPLEMENTED: the handler is a stub. mon_dispatch() in src/core/mon_dispatch.c reports the call as unimplemented without calling it.
| Handler | mon_237B_SetFileAccess |
| Code lines | 9 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 447.