C library for copying and deleting: easy question
In unix, is there a copy and delete file command, or should I just use "system". I worry about security risks if my program were hacked to abuse the function which deletes a temporary file the game creates.
Have a look at <unistd.h> (unlink()) for a start and here for more.
Copying a file is, as far as I know, typically done by hand (create the target file, copy the data).
For temporary files, you can use tmpfile() from <stdio.h> -- it automatically gets deleted when you close all the FILE* handles.
Copying a file is, as far as I know, typically done by hand (create the target file, copy the data).
For temporary files, you can use tmpfile() from <stdio.h> -- it automatically gets deleted when you close all the FILE* handles.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Quote: Original post by matt_j
the function which deletes a temporary file the game creates.
It sounds like you need to read about the tmpfile function.
EDIT: In my defense, Fruny is a ninja.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement