linux - How to remove (completely deleting) a file using C program without using remove system call? -


i've been curious how rem in linux works , trying write own c code can delete file when searched answer, got programs using remove() system call.

is there other way of doing without using system call writing own code job?

i've accomplished copying file through c filing can't find solution delete file through c.

if want delete file use the

remove 

function. if want have behind scenes of standard library, may download source of glibc (e.g.) , have @ implementation. see internal_syscall performed on linux os:

result = internal_syscall (unlink, err, 1, file); 

(from /sysdeps/unix/sysv/linux/unlinkat.c debian eglibc-2.15 package)

if want go further , not use syscall have implement own file system logic since file system syscall gives abstraction layer different filesystems.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -