| 89 | } |
| 90 | |
| 91 | static FILE* CreateFileWithDir(const String& fileName, const char* options) |
| 92 | { |
| 93 | FILE* fp = fopen(fileName.c_str(), options); |
| 94 | if (fp == NULL) |
| 95 | { |
| 96 | String fileDir = GetFileDir(fileName); |
| 97 | if (!fileDir.empty()) |
| 98 | { |
| 99 | RecursiveCreateDirectory(fileDir); |
| 100 | fp = fopen(fileName.c_str(), "w"); |
| 101 | } |
| 102 | } |
| 103 | return fp; |
| 104 | } |
| 105 | |
| 106 | static bool WriteAllText(const String& fileName, const String& data) |
| 107 | { |