File: Added file rename and deletion functions
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1436 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
75a254fccb
commit
7741de1dbf
@ -269,6 +269,24 @@ bool cFile::Exists(const AString & a_FileName)
|
||||
|
||||
|
||||
|
||||
bool cFile::Delete(const AString & a_FileName)
|
||||
{
|
||||
return (remove(a_FileName.c_str()) == 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool cFile::Rename(const AString & a_OrigFileName, const AString & a_NewFileName)
|
||||
{
|
||||
return (rename(a_OrigFileName.c_str(), a_NewFileName.c_str()) == 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int cFile::Printf(const char * a_Fmt, ...)
|
||||
{
|
||||
AString buf;
|
||||
|
@ -93,6 +93,12 @@ public:
|
||||
/// Returns true if the file specified exists
|
||||
static bool Exists(const AString & a_FileName);
|
||||
|
||||
/// Deletes a file, returns true if successful
|
||||
static bool Delete(const AString & a_FileName);
|
||||
|
||||
/// Renames a file, returns true if successful. May fail if dest already exists (libc-dependant)!
|
||||
static bool Rename(const AString & a_OrigFileName, const AString & a_NewFileName);
|
||||
|
||||
int Printf(const char * a_Fmt, ...);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user