|
removefunction
<cstdio>
int remove ( const char * filename ); Remove file Deletes the file whose name is specified in filename.This is an operation performed directly on a file; No streams are involved in the operation. Parameters
Return valueIf the file is successfully deleted, a zero value is returned.On failure, a nonzero value is reurned and the errno variable is set to the corresponding error code. Error codes are numerical values representing the type of failure occurred. A string interpreting this value can be printed to the standard error stream by a call to perror. Example
If the file myfile.txt existed before the execution and we had write access to it, then the file will be deleted and this message will be written to stdout: File successfully deleted Otherwise, a message similar to this will be written to stderr: Error deleting file: No such file or directory See also
|