瀏覽代碼

Corrected behaviour of File.READ_WRITE mode (fixes #378)

Bil Bas (Spooner) 10 年之前
父節點
當前提交
fba2d121b4
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      drivers/unix/file_access_unix.cpp
  2. 1 1
      drivers/windows/file_access_windows.cpp

+ 1 - 1
drivers/unix/file_access_unix.cpp

@@ -74,7 +74,7 @@ Error FileAccessUnix::_open(const String& p_path, int p_mode_flags) {
 	else if (p_mode_flags==WRITE)
 		mode_string="wb";
 	else if (p_mode_flags==READ_WRITE)
-		mode_string="wb+";
+		mode_string="rb+";
 	else
 		return ERR_INVALID_PARAMETER;
 

+ 1 - 1
drivers/windows/file_access_windows.cpp

@@ -65,7 +65,7 @@ Error FileAccessWindows::_open(const String& p_filename, int p_mode_flags) {
 	else if (p_mode_flags==WRITE)
 		mode_string=L"wb";
 	else if (p_mode_flags==READ_WRITE)
-		mode_string=L"wb+";
+		mode_string=L"rb+";
 	else
 		return ERR_INVALID_PARAMETER;