mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 20:06:56 -05:00
Completes the fix for the file name in Windows.
This commit is contained in:
parent
4d99094462
commit
d2a38b85db
2 changed files with 22 additions and 1 deletions
17
mingw.c
17
mingw.c
|
|
@ -231,6 +231,11 @@ int windows_stat(const char* file, struct windows_stat* st)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int windows_access(const char* file, int mode)
|
||||||
|
{
|
||||||
|
return _waccess(u8tou16(file), mode);
|
||||||
|
}
|
||||||
|
|
||||||
int stat_inode(const char* file, struct windows_stat* st)
|
int stat_inode(const char* file, struct windows_stat* st)
|
||||||
{
|
{
|
||||||
BY_HANDLE_FILE_INFORMATION info;
|
BY_HANDLE_FILE_INFORMATION info;
|
||||||
|
|
@ -313,7 +318,17 @@ FILE* windows_fopen(const char* file, const char* mode)
|
||||||
|
|
||||||
int windows_open(const char* file, int flags, ...)
|
int windows_open(const char* file, int flags, ...)
|
||||||
{
|
{
|
||||||
return _wopen(u8tou16(file), flags);
|
va_list args;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
va_start(args, flags);
|
||||||
|
if ((flags & O_CREAT) != 0)
|
||||||
|
ret = _wopen(u8tou16(file), flags, va_arg(args, int));
|
||||||
|
else
|
||||||
|
ret = _wopen(u8tou16(file), flags);
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
windows_dir* windows_opendir(const char* dir)
|
windows_dir* windows_opendir(const char* dir)
|
||||||
|
|
|
||||||
6
mingw.h
6
mingw.h
|
|
@ -32,6 +32,7 @@
|
||||||
#define fopen windows_fopen
|
#define fopen windows_fopen
|
||||||
#define open windows_open
|
#define open windows_open
|
||||||
#define stat windows_stat
|
#define stat windows_stat
|
||||||
|
#define access windows_access
|
||||||
#define off_t off64_t
|
#define off_t off64_t
|
||||||
#define lseek lseek64
|
#define lseek lseek64
|
||||||
#define fstat windows_fstat
|
#define fstat windows_fstat
|
||||||
|
|
@ -68,6 +69,11 @@ int windows_fstat(int fd, struct windows_stat* st);
|
||||||
*/
|
*/
|
||||||
int windows_stat(const char* file, struct windows_stat* st);
|
int windows_stat(const char* file, struct windows_stat* st);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Like the C access().
|
||||||
|
*/
|
||||||
|
int windows_access(const char* file, int mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like the C stat() with inode information.
|
* Like the C stat() with inode information.
|
||||||
* It doesn't work for all kind of files and directories. For example "\System Volume Information" cannot be opened.
|
* It doesn't work for all kind of files and directories. For example "\System Volume Information" cannot be opened.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue