diff options
author | Alexander Kuznetsov <kuzsasha@gmail.com> | 2012-05-02 01:46:55 +0400 |
---|---|---|
committer | Alexander Kuznetsov <kuzsasha@gmail.com> | 2012-05-02 01:46:55 +0400 |
commit | 274d3d2daa078645982a14399c07af8f084fdb3e (patch) | |
tree | 653b9dc787710a282299f71cfc3bc134faabb481 /source/blender/blenlib | |
parent | 5cd4b32b3886798b795090d273a7c6f67195d176 (diff) |
Fixes opening video files on Windows. [#30752]
Thanks Lockal for finding faulty stat function which helped a lot.
Now there BLI_stat. I will replace all other stat later.
*** Please use BLI_xxxx() functions ***
for file operations
Reported by Leon Cheung, Lockal, Believil
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_fileops.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 73220cbd739..1bf4efca8a0 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -55,6 +55,7 @@ int BLI_rename(const char *from, const char *to); int BLI_delete(const char *path, int dir, int recursive); int BLI_move(const char *path, const char *to); int BLI_create_symlink(const char *path, const char *to); +int BLI_stat(const char *path, struct stat *buffer); /* Directories */ diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 0245a9c90af..047463f1e26 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -493,6 +493,23 @@ int BLI_exists(const char *name) return(st.st_mode); } + +#ifdef WIN32 +int BLI_stat(const char *path, struct stat *buffer) +{ + int r; + UTF16_ENCODE(path); + r=_wstat(path_16,buffer); + UTF16_UN_ENCODE(path); + return r; +} +#else +int BLI_stat(const char *path, struct stat *buffer) +{ + return stat(path, buffer); +} +#endif + /* would be better in fileops.c except that it needs stat.h so add here */ int BLI_is_dir(const char *file) { |