mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Support for remove in Windows.
This commit is contained in:
parent
b299f9d368
commit
3358efc24a
2 changed files with 16 additions and 0 deletions
10
mingw.c
10
mingw.c
|
|
@ -335,6 +335,16 @@ int windows_rename(const char* a, const char* b)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int windows_remove(const char* a)
|
||||
{
|
||||
if (!_wremove(u8tou16(a))) {
|
||||
windows_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
FILE* windows_fopen(const char* file, const char* mode)
|
||||
{
|
||||
return _wfopen(u8tou16(file), u8tou16(mode));
|
||||
|
|
|
|||
6
mingw.h
6
mingw.h
|
|
@ -42,6 +42,7 @@
|
|||
#define HAVE_FSYNC 1
|
||||
#define fsync _commit
|
||||
#define rename windows_rename
|
||||
#define remove windows_remove
|
||||
#define mkdir(a, b) windows_mkdir(a)
|
||||
#define dirent windows_dirent
|
||||
#define DIR windows_dir
|
||||
|
|
@ -102,6 +103,11 @@ int windows_ftruncate(int fd, off64_t off);
|
|||
*/
|
||||
int windows_rename(const char* a, const char* b);
|
||||
|
||||
/**
|
||||
* Like the C remove().
|
||||
*/
|
||||
int windows_remove(const char* a);
|
||||
|
||||
/**
|
||||
* Like the C fopen().
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue