diff options
| author | oy <Tom_Adams@web.de> | 2010-12-08 00:13:59 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-12-08 00:13:59 +0100 |
| commit | 7c26dcbadd710e2aa0b8a010ecb2c03b7be56caa (patch) | |
| tree | ffac91b268109ce535184830289c8b78cb55f6a4 /src/base | |
| parent | d30dd9da8fce880a44e598a41710015d1f4733a3 (diff) | |
| download | zcatch-7c26dcbadd710e2aa0b8a010ecb2c03b7be56caa.tar.gz zcatch-7c26dcbadd710e2aa0b8a010ecb2c03b7be56caa.zip | |
moved function to remove files
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/system.c | 7 | ||||
| -rw-r--r-- | src/base/system.h | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/base/system.c b/src/base/system.c index 6339991d..5799d972 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -1016,6 +1016,13 @@ int fs_parent_dir(char *path) return 1; } +int fs_remove(const char *filename) +{ + if(remove(filename) != 0) + return 1; + return 0; +} + int fs_rename(const char *oldname, const char *newname) { if(rename(oldname, newname) != 0) diff --git a/src/base/system.h b/src/base/system.h index c863a33f..39e7c994 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -996,6 +996,21 @@ int fs_chdir(const char *path); int fs_parent_dir(char *path); /* + Function: fs_remove + Deletes the file with the specified name. + + Parameters: + filename - The file to delete + + Returns: + Returns 0 on success, 1 on failure. + + Remarks: + - The strings are treated as zero-terminated strings. +*/ +int fs_remove(const char *filename); + +/* Function: fs_rename Renames the file or directory. If the paths differ the file will be moved. |