> 1. Is it possible to protect a file in a unix environment [against
Maybe. What type of deletion do you wish to protect against, and what
lengths are you willing to go to?
If write permission is denied on a file, then most versions of rm will
normally ask for confirmation before removing it. You may be able to
simply remove write permission.
If you wish to cause unlink() syscalls to fail, nothing you do to the
file itself will work. All unlink() requires is write access to the
directory the name being unlinked appears in.
UNIX does not have a separate delete permission bit, at least partly
because deletion is not an operation on a file; it is an operation on a
file *name*. Files themselves are deleted implicitly as soon as they
become unreferenceable. Since the permission bits are attached to
files, not names, a delete permission bit doesn't make as much sense as
it might at first appear.
This actually brings up a subtle point: do you want to protect the name
or the file itself? If the latter, you an simply keep a (hard) link to
it in another directory that only you can access.
Quote:> 2. Is it possible use a magnetic tape to write an output file
> directly from a program by assigning the device ?
I'm not sure what you mean. Since you earlier mentioned VMS, I assume
you are looking for something like the VMS ASSIGN command. UNIX does
not have anything directly comparable, though symbolic links can serve
in some circumstances. What you would normally do in UNIX is provide
the appropriate name in /dev as the output filename; this would
correspond to, in VMS, giving something such as MTA0: as the output
filename for a program.