>>-v_remove--vntoken--filename---------------------------------><
Function
v_remove invokes the v_remove callable service to remove
a directory entry.
Parameters
- vntoken
- A variable name that contains the vnode token for the directory
from which filename is to be removed.
- filename
- The name for the directory entry. The directory entry could
be identified by a name for a file, the name of a hard link to a file,
or the name of a symbolic link.
Usage notes
- If the name specified refers to a symbolic link, the symbolic
link file named by filename is deleted.
- If the v_remove service is successful and the link count becomes
zero, the file is deleted. The contents of the file are discarded,
and the space it occupied is freed for reuse. However, if another
process (or more than one) has the file open or has a valid vnode
token when the last link is removed, the file contents are not removed
until the last process closes the file or releases the vnode token.
- When the v_remove service is successful in removing a directory
entry and decrementing the link count, whether or not the link count
becomes zero, it returns control to the caller with RETVAL 0.
It updates the change and modification times for the parent directory,
and the change time for the file itself (unless the file is deleted).
- You cannot remove a directory using v_remove. To remove
a directory, refer to v_rmdir.
Example
In the following example, assume that
dirtok and
file were
assigned values earlier in the exec:
"v_remove dirtok (file)"