If you want to delete the file, use
remove
function. If you want to look behind the scenes of the standard library, you can download the glibc source (for example) and look at the implementation. You will see that on linux os INTERNAL_SYSCALL will be executed:
result = INTERNAL_SYSCALL (unlink, err, 1, file);
(from / sysdeps / unix / sysv / linux / unlinkat.c from the debian package eglibc-2.15)
If you want to go further and not even use this syscall, you will have to implement your own file system logic, since the system call of the file system simply provides an abstraction level for different file systems.
source share