summaryrefslogtreecommitdiffstats
path: root/drivers/unix
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/dir_access_unix.cpp35
-rw-r--r--drivers/unix/os_unix.cpp4
2 files changed, 19 insertions, 20 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index f0e4511b1d..b3bea8ac27 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -67,8 +67,8 @@ bool DirAccessUnix::file_exists(String p_file) {
if (p_file.is_rel_path())
p_file=current_dir.plus_file(p_file);
- else
- p_file=fix_path(p_file);
+
+ p_file=fix_path(p_file);
struct stat flags;
bool success = (stat(p_file.utf8().get_data(),&flags)==0);
@@ -88,8 +88,8 @@ bool DirAccessUnix::dir_exists(String p_dir) {
if (p_dir.is_rel_path())
p_dir=get_current_dir().plus_file(p_dir);
- else
- p_dir=fix_path(p_dir);
+
+ p_dir=fix_path(p_dir);
struct stat flags;
bool success = (stat(p_dir.utf8().get_data(),&flags)==0);
@@ -105,8 +105,8 @@ uint64_t DirAccessUnix::get_modified_time(String p_file) {
if (p_file.is_rel_path())
p_file=current_dir.plus_file(p_file);
- else
- p_file=fix_path(p_file);
+
+ p_file=fix_path(p_file);
struct stat flags;
bool success = (stat(p_file.utf8().get_data(),&flags)==0);
@@ -201,8 +201,11 @@ Error DirAccessUnix::make_dir(String p_dir) {
if (p_dir.is_rel_path())
p_dir=get_current_dir().plus_file(p_dir);
- else
- p_dir=fix_path(p_dir);
+
+
+ p_dir=fix_path(p_dir);
+
+
#if 1
@@ -245,7 +248,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
chdir(current_dir.utf8().get_data()); //ascii since this may be unicode or wathever the host os wants
bool worked=(chdir(p_dir.utf8().get_data())==0); // we can only give this utf8
-#ifndef IPHONE_ENABLED
+
String base = _get_root_path();
if (base!="") {
@@ -255,7 +258,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
if (!new_dir.begins_with(base))
worked=false;
}
-#endif
+
if (worked) {
getcwd(real_current_dir_name,2048);
@@ -287,13 +290,13 @@ Error DirAccessUnix::rename(String p_path,String p_new_path) {
if (p_path.is_rel_path())
p_path=get_current_dir().plus_file(p_path);
- else
- p_path=fix_path(p_path);
+
+ p_path=fix_path(p_path);
if (p_new_path.is_rel_path())
p_new_path=get_current_dir().plus_file(p_new_path);
- else
- p_new_path=fix_path(p_new_path);
+
+ p_new_path=fix_path(p_new_path);
return ::rename(p_path.utf8().get_data(),p_new_path.utf8().get_data())==0?OK:FAILED;
}
@@ -301,8 +304,8 @@ Error DirAccessUnix::remove(String p_path) {
if (p_path.is_rel_path())
p_path=get_current_dir().plus_file(p_path);
- else
- p_path=fix_path(p_path);
+
+ p_path=fix_path(p_path);
struct stat flags;
if ((stat(p_path.utf8().get_data(),&flags)!=0))
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 8cb7c7b698..fd515d6dd3 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -357,7 +357,6 @@ Error OS_Unix::execute(const String& p_path, const List<String>& p_arguments,boo
pid_t pid = fork();
ERR_FAIL_COND_V(pid<0,ERR_CANT_FORK);
- //print("execute: %s\n",p_path.utf8().get_data());
if (pid==0) {
@@ -394,8 +393,6 @@ Error OS_Unix::execute(const String& p_path, const List<String>& p_arguments,boo
pid_t rpid = waitpid(pid,&status,0);
if (r_exitcode)
*r_exitcode=WEXITSTATUS(status);
-
- print("returned: %i, waiting for: %i\n",rpid,pid);
} else {
if (r_child_id)
@@ -498,7 +495,6 @@ String OS_Unix::get_executable_path() const {
char buf[256];
memset(buf,0,256);
readlink("/proc/self/exe", buf, sizeof(buf));
- //print_line("Exec path is:"+String(buf));
String b;
b.parse_utf8(buf);
if (b=="") {