nux-1.14.0
|
Public Member Functions | |
virtual NSerializer * | CreateFileReader (const TCHAR *Filename, DWORD Flags, LogOutputDevice &Error=GNullDevice) |
virtual NSerializer * | CreateFileWriter (const TCHAR *Filename, DWORD Flags, LogOutputDevice &Error=GNullDevice) |
t_s64 | FileSize (const TCHAR *Filename) |
bool | FileExist (const TCHAR *Filename) |
int | Copy (const TCHAR *DestFile, const TCHAR *SrcFile, bool OverWriteExisting, bool OverWriteReadOnly, NFileTransferMonitor *Monitor) |
bool | Move (const TCHAR *Dest, const TCHAR *Src, bool OverWriteExisting=true, bool OverWriteReadOnly=false, NFileTransferMonitor *Monitor=NULL) |
bool | Delete (const TCHAR *Filename, bool OverWriteReadOnly=false) |
bool | IsReadOnly (const TCHAR *Filename) |
bool | IsDirectory (const TCHAR *DirectoryName) |
bool | IsHidden (const TCHAR *Filename) |
bool | GetFileAttribute (const TCHAR *Filename, bool &isDirectory, bool &isReadOnly, bool &isHidden, t_s64 &Size) |
bool | MakeDirectory (const TCHAR *Path, bool CreateCompletePath=false) |
bool | DeleteDirectory (const TCHAR *Path, bool DeleteContentFirst=false) |
Delete directory. | |
void | FindFiles (std::vector< NString > &Result, const TCHAR *Filename, bool Files, bool Directories) |
void | ListFilesInDirectory (std::vector< NString > &Result, const TCHAR *DirName) |
double | GetFileAgeSeconds (const TCHAR *Filename) |
time_t | GetFileLastModified (const TCHAR *Filename) |
bool | SetDefaultDirectory () |
NString | GetCurrentDirectory () |
bool | GetTimeStamp (const TCHAR *Filename, FileTimeStamp &Timestamp) |
Definition at line 98 of file NFileManagerGNU.h.
bool nux::NFileManagerGNU::DeleteDirectory | ( | const TCHAR * | Path, |
bool | DeleteContentFirst = false |
||
) | [virtual] |
Delete directory.
Delete a Directory. If DeleteContent is true, The content of the directory is deleted before the directory itself;
Path | Path of the directory |
DeleteContentFirst | Delete the content of the directory before deleting the directory itself. |
Reimplemented from nux::NFileManagerGeneric.
Definition at line 692 of file NFileManagerGNU.cpp.
{ // if(DeleteContentFirst) // { // return NFileManagerGeneric::DeleteDirectory(Path, DeleteContentFirst); // } // if((::RemoveDirectory(Path) == 0) && (::GetLastError() != ERROR_FILE_NOT_FOUND)) // { // nuxDebugMsg(TEXT("[NFileManagerWindows::DeleteDirectory] Error deleting directory '%s' (GetLastError: %d)"), Path, ::GetLastError()); // return false; // } return true; }
t_s64 nux::NFileManagerGNU::FileSize | ( | const TCHAR * | Filename | ) | [virtual] |
Implements nux::NFileManager.
Definition at line 492 of file NFileManagerGNU.cpp.
{ struct stat sb; if (stat (TCHAR_TO_ANSI (Filename), &sb) != 0) { nuxDebugMsg (TEXT ("[NFileManagerGNU::FileSize] Can't get file size") ); return 0; } if (sb.st_mode & S_IFDIR) { // This is a directory return 0; } return sb.st_size; }
bool nux::NFileManagerGNU::GetFileAttribute | ( | const TCHAR * | Filename, |
bool & | isDirectory, | ||
bool & | isReadOnly, | ||
bool & | isHidden, | ||
t_s64 & | Size | ||
) | [virtual] |
Implements nux::NFileManager.
Definition at line 637 of file NFileManagerGNU.cpp.
{ isDirectory = false; isReadOnly = false; isHidden = false; Size = 0; struct stat sb; if (stat (TCHAR_TO_ANSI (Filename), &sb) != 0) { return false; } if (sb.st_mode & S_IFDIR) { isDirectory = true; } if ( (sb.st_mode & S_IRUSR) && ! (sb.st_mode & S_IWUSR) ) { isReadOnly = true; } Size = sb.st_mode; return true; }