Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cxong/tinydir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLautis Sun <lautis0503@gmail.com>2016-06-27 07:01:06 +0300
committerGitHub <noreply@github.com>2016-06-27 07:01:06 +0300
commit4ebb8afd3d0a9324127d005bb868bfc7680b33f2 (patch)
treef1a82c64665b187ec4513600535c99d23b1368da
parent8e4edddc01de7544557558deec84a17f0d6d4823 (diff)
Fix _wfopen for windows
Now we can write to files with unicode in path.
-rw-r--r--samples/list_to_file.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/samples/list_to_file.c b/samples/list_to_file.c
index 0761684..dd13a2c 100644
--- a/samples/list_to_file.c
+++ b/samples/list_to_file.c
@@ -13,7 +13,13 @@ int main(void) {
tinydir_dir dir;
tinydir_open(&dir, TINYDIR_STRING("/path/to/dir"));
- fp = fopen("/file/to/output","wb");
+ fp =
+#ifdef _WIN32
+ _wfopen(
+#else
+ fopen(
+#endif
+ TINYDIR_STRING("/file/to/output"), TINYDIR_STRING("wb"));
#ifdef _WIN32
fwrite(bom, 1, 2, fp);