mirror of
https://github.com/nzbget/nzbget.git
synced 2026-05-19 10:34:28 -04:00
#131: wrapped function "remove" into module FileSystem
under name “DeleteFile”.
This commit is contained in:
@@ -363,7 +363,7 @@ bool FileSystem::MoveFile(const char* srcFilename, const char* dstFilename)
|
||||
#ifndef WIN32
|
||||
if (!ok && errno == EXDEV)
|
||||
{
|
||||
ok = CopyFile(srcFilename, dstFilename) && remove(srcFilename) == 0;
|
||||
ok = CopyFile(srcFilename, dstFilename) && DeleteFile(srcFilename);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -402,6 +402,11 @@ bool FileSystem::CopyFile(const char* srcFilename, const char* dstFilename)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FileSystem::DeleteFile(const char* filename)
|
||||
{
|
||||
return remove(filename) == 0;
|
||||
}
|
||||
|
||||
bool FileSystem::FileExists(const char* filename)
|
||||
{
|
||||
#ifdef WIN32
|
||||
@@ -425,7 +430,7 @@ bool FileSystem::FileExists(const char* filename)
|
||||
bool FileSystem::FileExists(const char* path, const char* filenameWithoutPath)
|
||||
{
|
||||
BString<1024> fullFilename("%s%c%s", path, (int)PATH_SEPARATOR, filenameWithoutPath);
|
||||
bool exists = FileSystem::FileExists(fullFilename);
|
||||
bool exists = FileExists(fullFilename);
|
||||
return exists;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user