diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-14 14:16:17 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-14 14:16:17 +0200 |
commit | 92e7e5c615efb591210ffd978afa012027f2c84f (patch) | |
tree | 1271b2281ab938f59f3f2d933a6c873fd3f633ba /src/OSSupport/File.cpp | |
parent | 1.8: Updated scoreboard packets. (diff) | |
parent | Added new Qt-based biome visualiser. (diff) | |
download | cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.gz cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.bz2 cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.lz cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.xz cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.zst cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.zip |
Diffstat (limited to 'src/OSSupport/File.cpp')
-rw-r--r-- | src/OSSupport/File.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index 2194c46ee..cb6031da6 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -298,7 +298,7 @@ bool cFile::Rename(const AString & a_OrigFileName, const AString & a_NewFileName bool cFile::Copy(const AString & a_SrcFileName, const AString & a_DstFileName) { #ifdef _WIN32 - return (CopyFile(a_SrcFileName.c_str(), a_DstFileName.c_str(), true) != 0); + return (CopyFileA(a_SrcFileName.c_str(), a_DstFileName.c_str(), true) != 0); #else // Other OSs don't have a direct CopyFile equivalent, do it the harder way: std::ifstream src(a_SrcFileName.c_str(), std::ios::binary); @@ -322,7 +322,7 @@ bool cFile::Copy(const AString & a_SrcFileName, const AString & a_DstFileName) bool cFile::IsFolder(const AString & a_Path) { #ifdef _WIN32 - DWORD FileAttrib = GetFileAttributes(a_Path.c_str()); + DWORD FileAttrib = GetFileAttributesA(a_Path.c_str()); return ((FileAttrib != INVALID_FILE_ATTRIBUTES) && ((FileAttrib & FILE_ATTRIBUTE_DIRECTORY) != 0)); #else struct stat st; @@ -337,7 +337,7 @@ bool cFile::IsFolder(const AString & a_Path) bool cFile::IsFile(const AString & a_Path) { #ifdef _WIN32 - DWORD FileAttrib = GetFileAttributes(a_Path.c_str()); + DWORD FileAttrib = GetFileAttributesA(a_Path.c_str()); return ((FileAttrib != INVALID_FILE_ATTRIBUTES) && ((FileAttrib & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE)) == 0)); #else struct stat st; @@ -366,7 +366,7 @@ int cFile::GetSize(const AString & a_FileName) bool cFile::CreateFolder(const AString & a_FolderPath) { #ifdef _WIN32 - return (CreateDirectory(a_FolderPath.c_str(), NULL) != 0); + return (CreateDirectoryA(a_FolderPath.c_str(), NULL) != 0); #else return (mkdir(a_FolderPath.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) == 0); #endif @@ -396,13 +396,13 @@ AStringVector cFile::GetFolderContents(const AString & a_Folder) // Find all files / folders: FileFilter.append("*.*"); HANDLE hFind; - WIN32_FIND_DATA FindFileData; - if ((hFind = FindFirstFile(FileFilter.c_str(), &FindFileData)) != INVALID_HANDLE_VALUE) + WIN32_FIND_DATAA FindFileData; + if ((hFind = FindFirstFileA(FileFilter.c_str(), &FindFileData)) != INVALID_HANDLE_VALUE) { do { AllFiles.push_back(FindFileData.cFileName); - } while (FindNextFile(hFind, &FindFileData)); + } while (FindNextFileA(hFind, &FindFileData)); FindClose(hFind); } |