What are the system calls that can be used to delete a file on Linux? I am not referring to just the system calls used by the libc-wrapper(which in-turn are used by command line tools).
Other than unlink
and unlinkat
what are the system calls that could be used to delete files on a Linux machine?
rename()
andrenameat()
can be used to delete a file by renaming another file over it.If you consider making a file empty to be a form of deletion, a variety of system calls, including
truncate()
andopen()
withO_TRUNC
, can do that.