T.R | Title | User | Personal Name | Date | Lines |
---|
579.1 | chmod(2) and umask(2) | TOOK::MICHAUD | Jeff Michaud | Mon Oct 12 1987 19:06 | 2 |
| chmod(2) and fchmod(2) to change the protection on an exsisting
file. Use umask(2) to control the protection assigned on creation.
|
579.2 | Must be called from BLISS | TSG::KARDON | | Mon Oct 12 1987 20:37 | 11 |
| Thanks for the names of the C run-time routines.
Unfortunately, I'm still programming in BLISS. Could anyone
tell me either:
a) The names of alternate routines, easily callable
from BLISS.
b) How I call a C system function from BLISS.
Thanks,
-Scott
|
579.3 | | JANUS::PALKA | | Tue Oct 13 1987 07:53 | 15 |
| SYS$SETDFPROT allows you to read and/or write the default file
protection for the process. (see the RMS manual for details). This is
the equivalent of SET PROT/DEF. This is overridden by the protection of
an existing file of the same name, or by a default protection in the
directory.
You can change the protection of a file you have been writing to if you
link an XABPRO to the FAB when you use $CLOSE. I dont think opening the
file for write access and then closing it is sufficient.
You can probably also change the protection by direct QIOs (IO$_ACCESS
followed by IO$_MODIFY?) to the ACP.
Andrew
|
579.4 | Try the toolshed | ROCK::TUMBLIN | | Tue Oct 13 1987 12:30 | 6 |
| I remember seeing a couple of routines in the toolshed to set the
file protection, written by Peter Gilbert. You may want to check
these routines.
/Henry
|
579.5 | | AKA::PARK | Who you jiving with that cosmic debris? | Fri Oct 16 1987 16:13 | 35 |
|
re: .2
All of the Vax C run-time routines adhere to the VAX calling standard.
Therefore, you only need to know what the parameters are and what
mechanism they are passed by.
For chmod:
status.wlc.v = chmod( file_spec.rt.r , mode.rlu.v );
file_spec - Address of a zero-terminated string containing
the filename of the file to change protection.
mode - Protection bits: as follows:
xxxxxxxxxxxxxxxxxxxxxxxooooooooo
<-----don't care------>rwerwerwe
^ ^ ^
| | |
Owner---+ | |
Group------+ |
World---------+
returns 0 if successful, -1 if failure
For umask:
status.wlc.v = umask( mode_complement.rlu.v );
mode - bitmask of bits to turn OFF when creating a new file.
Same as in chmod.
returns same values as chmod
-x
|
579.6 | | VIDEO::LEICHTERJ | Jerry Leichter | Fri Oct 16 1987 22:43 | 4 |
| While chmod will work, umask won't - it has no effect on the VMS-level default
protection - it sets a cell used by the C RTL when IT creates files.
-- Jerry
|