diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index bbcfed6ad..7e5c1af77 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -1660,14 +1660,8 @@ BOOLEAN xvt_fsys_is_removable_drive(const char* path) if (path && *path) { -#ifdef __WXMSW__ const wxString strRoot = get_disk_root(path); yes = ::GetDriveType(strRoot) == DRIVE_REMOVABLE; -#else - char dev[_MAX_PATH]; - OsLinux_GetFileSys(path, dev, NULL, NULL); - yes = strncmp(dev, "/dev/fd", 7) == 0; -#endif } return yes; } @@ -1681,12 +1675,8 @@ BOOLEAN xvt_fsys_is_network_drive(const char* path) yes = TRUE; else { -#ifdef __WXMSW__ const wxString strRoot = get_disk_root(path); yes = ::GetDriveType(strRoot) == DRIVE_REMOTE; -#else - yes = OsLinux_IsNetworkDrive(path); -#endif } } return yes; @@ -1699,12 +1689,8 @@ BOOLEAN xvt_fsys_is_fixed_drive(const char* path) { if (!wxIsPathSeparator(path[0]) || !wxIsPathSeparator(path[1])) { -#ifdef __WXMSW__ const wxString strRoot = get_disk_root(path); yes = ::GetDriveType(strRoot) == DRIVE_FIXED; -#else - yes = !(xvt_fsys_is_network_drive(path) || xvt_fsys_is_removable_drive(path)); -#endif } } return yes; @@ -1760,7 +1746,6 @@ long xvt_fsys_file_attr(const char* path, long attr) long ret = 0; if (path && *path && attr >= XVT_FILE_ATTR_MINIMUM && attr <= XVT_FILE_ATTR_MAXIMUM) { - const wxString name(path); switch (attr) { case XVT_FILE_ATTR_EXIST: @@ -1773,7 +1758,7 @@ long xvt_fsys_file_attr(const char* path, long attr) ret = xvt_fsys_access(path, 2) == 0; break; case XVT_FILE_ATTR_DIRECTORY: - ret = ::wxDirExists(name); + ret = ::wxDirExists(path); break; case XVT_FILE_ATTR_SIZE: { @@ -1796,12 +1781,12 @@ long xvt_fsys_file_attr(const char* path, long attr) xvt_slist_destroy(files); return ret; } - const wxULongLong sz = wxFileName::GetSize(name); + const wxULongLong sz = wxFileName::GetSize(path); ret = sz.GetHi() != 0 ? INT_MAX : sz.GetLo(); } break; case XVT_FILE_ATTR_MTIME: - ret = ::wxFileModificationTime(name); + ret = ::wxFileModificationTime(path); break; default: break; } @@ -1974,10 +1959,11 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest) input->Read(*output); wxStreamError err = output->GetLastError(); ok = (err == wxSTREAM_NO_ERROR); + output->Close(); } if (input != NULL) delete input; - if (output != NULL) + if (output != NULL && scheme != "ftp") delete output; return ok; } @@ -3743,31 +3729,7 @@ void xvt_sys_searchenv(const char * filename, const char * varname, char * pathn void xvt_sys_search_env(const char * filename, const char * varname, char * pathname) { -#ifdef __WXMSW__ _searchenv(filename, varname, pathname); -#else - const char * value = wxGetEnv(varname); - if (value) - { - char path_list[4096]; - strcpy(path_list, value); - for (const char* s = path_list; *s; ) - { - char* s1 = strchr(s, ';'); - if (s1 != NULL) - *s1 = '\0'; - xvt_fsys_build_pathname(pathname, NULL, s, filename, NULL, NULL); - if (xvt_fsys_file_exists(pathname)) - break; - if (s1 != NULL) - s = s1 + 1; - else - break; - } - } - else - *pathname = '\0'; -#endif } BOOLEAN xvt_sys_set_env(const char* varname, const char* value)