aboutsummaryrefslogtreecommitdiff
path: root/unix/os/doc/zfprot.hlp
blob: dd9892685dc5689bfceea833827f38c86e891b6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.help zfprot May84 "System Interface"
.ih
NAME
zfprot -- set, remove, or query file delete protection
.ih
SYNOPSIS
.nf
zfprot (osfn, protflag, status)

packed	char osfn[ARB]		# OS filename
int	protflag		# operation to be performed
int	status
.fi
.ih
DESCRIPTION
A protected file cannot be deleted, accidentally or otherwise.
Protecting a file does not remove write permission.
File protection is set, removed, or queried as specified by the \fIprotflag\fR
argument, which has the following values:

.nf
	REMOVE_PROTECTION	0
	SET_PROTECTION		1
	QUERY_PROTECTION	2
.fi

It is not an error to attempt to protect a file which is already protected,
nor is it an error to attempt to remove protection from a file which is not
protected.
.ih
RETURN VALUE
OK is returned if a set_protection or remove_protection operation is
successful.  YES (protected) or NO (not protected) is returned in response
to a query.  ERR is returned if the named file does not exist or if
the operation cannot be performed.
.ih
NOTES
FIO will query for file protection before attempting to delete a file.
If the host system does not provide file protection facilities they can
often be faked by creating a hidden file in the same directory; the existence
of the file will indicate that the file is protected.  If the hidden file
technique is used, the hidden file should not be seen when the directory
is read by the high level code.
.ih
SEE ALSO
zfdele
.endhelp