diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/file_sdmc.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/file_sys/file_sdmc.cpp b/src/core/file_sys/file_sdmc.cpp index a4b90670a..b01d96e3d 100644 --- a/src/core/file_sys/file_sdmc.cpp +++ b/src/core/file_sys/file_sdmc.cpp | |||
| @@ -38,12 +38,15 @@ bool File_SDMC::Open() { | |||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | std::string mode_string; | 40 | std::string mode_string; |
| 41 | if (mode.read_flag && mode.write_flag) | 41 | if (mode.create_flag) |
| 42 | mode_string = "w+"; | 42 | mode_string = "w+"; |
| 43 | else if (mode.write_flag) | ||
| 44 | mode_string = "r+"; // Files opened with Write access can be read from | ||
| 43 | else if (mode.read_flag) | 45 | else if (mode.read_flag) |
| 44 | mode_string = "r"; | 46 | mode_string = "r"; |
| 45 | else if (mode.write_flag) | 47 | |
| 46 | mode_string = "w"; | 48 | // Open the file in binary mode, to avoid problems with CR/LF on Windows systems |
| 49 | mode_string += "b"; | ||
| 47 | 50 | ||
| 48 | file = new FileUtil::IOFile(path, mode_string.c_str()); | 51 | file = new FileUtil::IOFile(path, mode_string.c_str()); |
| 49 | return true; | 52 | return true; |