Skip to content

Commit

Permalink
fs: Remove platform-specific 'fs_deleteFile'
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelheilmann committed Jan 17, 2018
1 parent b9421aa commit 23a89d3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
5 changes: 0 additions & 5 deletions egolib/src/egolib/Platform/file_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ int fs_removeDirectory(const std::string& pathname)
return 0;
}

void fs_deleteFile(const std::string& pathname)
{
unlink(pathname.c_str());
}

bool fs_copyFile(const std::string& source, const std::string& target)
{
char buf[4096] = EMPTY_CSTR;
Expand Down
9 changes: 0 additions & 9 deletions egolib/src/egolib/Platform/file_mac.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,6 @@ int fs_removeDirectory(const char *dirName)
}
}

void fs_deleteFile(const char *fileName)
{
@autoreleasepool {
NSString *path = [[NSString alloc] initWithUTF8String:fileName];
[[NSFileManager defaultManager] removeItemAtPath:path error:nil];
[path release];
}
}

bool fs_copyFile(const std::string& source, const std::string& target)
{
@autoreleasepool {
Expand Down
8 changes: 0 additions & 8 deletions egolib/src/egolib/Platform/file_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,6 @@ int fs_removeDirectory(const std::string& dirname)
return (0 != RemoveDirectory(dirname.c_str())) ? 0 : 1;
}

void fs_deleteFile( const std::string& filename )
{
if (!filename.empty())
{
DeleteFile(filename.c_str());
}
}

bool fs_copyFile(const std::string& source, const std::string& target)
{
if (source.empty() || target.empty())
Expand Down
6 changes: 6 additions & 0 deletions egolib/src/egolib/file_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ void fs_removeDirectoryAndContents(const char *dirname)
fs_removeDirectory(dirname);
}

//--------------------------------------------------------------------------------------------
void fs_deleteFile(const std::string& pathname)
{
id::file_system::delete_regular(pathname);
}

//--------------------------------------------------------------------------------------------
void fs_copyDirectory(const char *sourceDir, const char *targetDir)
{
Expand Down

0 comments on commit 23a89d3

Please sign in to comment.