Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/fileops.c
| Show First 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | |||||
| void *BLI_gzopen(const char *filename, const char *mode) | void *BLI_gzopen(const char *filename, const char *mode) | ||||
| { | { | ||||
| gzFile gzfile; | gzFile gzfile; | ||||
| BLI_assert(!BLI_path_is_rel(filename)); | BLI_assert(!BLI_path_is_rel(filename)); | ||||
| /* xxx Creates file before transcribing the path */ | /* xxx Creates file before transcribing the path */ | ||||
| if (mode[0] == 'w') { | if (mode[0] == 'w') { | ||||
| fclose(ufopen(filename, "a")); | FILE *file = ufopen(filename, "a"); | ||||
| if (file == NULL) { | |||||
| /* File couldn't be opened, e.g. due to permission error. */ | |||||
| return NULL; | |||||
| } | |||||
| fclose(file); | |||||
| } | } | ||||
| /* temporary #if until we update all libraries to 1.2.7 | /* temporary #if until we update all libraries to 1.2.7 | ||||
| * for correct wide char path handling */ | * for correct wide char path handling */ | ||||
| # if ZLIB_VERNUM >= 0x1270 | # if ZLIB_VERNUM >= 0x1270 | ||||
| UTF16_ENCODE(filename); | UTF16_ENCODE(filename); | ||||
| gzfile = gzopen_w(filename_16, mode); | gzfile = gzopen_w(filename_16, mode); | ||||
| ▲ Show 20 Lines • Show All 1,023 Lines • Show Last 20 Lines | |||||