Parameters: name (string or NxK string array) – name of file or files to delete. Returns: ret (scalar or NxK matrix) – scalar if name is a string. If name is an NxK string array, ret will be an NxK matrix reflecting the success or failure of each separate file deletion. ret will be zero if file deletion is successful.
// Create random x matrix x = rndn(500,1); // Save as GAUSS dataset saved(x, "x.dat", "X1"); // Delete file deleteFile("x.dat");
Now we will try again to delete the
x.dat file :
// Delete file deleteFile("x.dat");
errno value of 2 indicates that the file
x.dat no longer exists when we try to delete the file the second time.
deleteFile() calls the C library
unlink function for each file. If
fails it sets the C library
deleteFile() returns the value of
unlink fails, otherwise it returns zero. If you want detailed
information about the reason for failure, consult the C library
documentation for your platform for details.