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/intern/storage.c | |
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/intern/storage.c')
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 17 |
1 files changed, 17 insertions, 0 deletions
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) { |