The path_unlink_file()
function unlinks a file at the specified path. If the file has only one hardlink (i.e., its link count is 1), it will be deleted from the file system. It requires the PATH_UNLINK_FILE
right on the base file descriptor.
On POSIX systems, a similar functionality is provided by the unlink()
function. It removes the specified file from the file system. If the file has no other hardlinks, it is completely deleted. The unlink()
function is part of the POSIX standard and is widely supported across different platforms.
Note
The path_unlink_file()
function unlinks a file at the specified path, deleting it if the number of hardlinks is 1. It checks the necessary rights on the base file descriptor. On POSIX systems, a similar functionality is provided by the unlink()
function.