summaryrefslogtreecommitdiff
path: root/drivers/unix/file_access_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix/file_access_unix.cpp')
-rw-r--r--drivers/unix/file_access_unix.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index c25d34125d..10f6be3cbe 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -33,7 +33,8 @@
#if defined(UNIX_ENABLED) || defined(LIBC_FILEIO_ENABLED)
#include "core/os/os.h"
-#include "print_string.h"
+#include "core/print_string.h"
+
#include <sys/stat.h>
#include <sys/types.h>
@@ -106,7 +107,6 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
if (is_backup_save_enabled() && (p_mode_flags & WRITE) && !(p_mode_flags & READ)) {
save_path = path;
path = path + ".tmp";
- //print_line("saving instead to "+path);
}
f = fopen(path.utf8().get_data(), mode_string);
@@ -134,9 +134,6 @@ void FileAccessUnix::close() {
}
if (save_path != "") {
-
- //unlink(save_path.utf8().get_data());
- //print_line("renaming...");
int rename_error = rename((save_path + ".tmp").utf8().get_data(), save_path.utf8().get_data());
if (rename_error && close_fail_notify) {
@@ -291,8 +288,7 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) {
if (!err) {
return flags.st_mtime;
} else {
- print_line("ERROR IN: " + p_file);
-
+ ERR_EXPLAIN("Failed to get modified time for: " + p_file);
ERR_FAIL_V(0);
};
}
@@ -313,11 +309,10 @@ FileAccess *FileAccessUnix::create_libc() {
CloseNotificationFunc FileAccessUnix::close_notification_func = NULL;
-FileAccessUnix::FileAccessUnix() {
-
- f = NULL;
- flags = 0;
- last_error = OK;
+FileAccessUnix::FileAccessUnix() :
+ f(NULL),
+ flags(0),
+ last_error(OK) {
}
FileAccessUnix::~FileAccessUnix() {