System calls in Linux that can be used to delete f

2019-09-08 12:25发布

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?

1条回答
爷的心禁止访问
2楼-- · 2019-09-08 12:55

rename() and renameat() 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() and open() with O_TRUNC, can do that.

查看更多
登录 后发表回答