Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
Low level file access. More...
#include <FXFile.h>
Public Member Functions | |
FXFile () | |
Construct file. | |
FXFile (FXInputHandle h) | |
Construct file and attach existing handle h. | |
FXFile (const FXString &filename, FXuint m=FXIO::Reading, FXuint perm=FXIO::AllReadWrite) | |
Construct and open a file. | |
virtual FXbool | open (const FXString &filename, FXuint m=FXIO::Reading, FXuint perm=FXIO::AllReadWrite) |
Open file. | |
virtual FXbool | isSerial () const |
Return true if serial access only. | |
virtual FXlong | position () const |
Get current file position. | |
virtual FXlong | position (FXlong offset, FXuint from=FXIO::Begin) |
Change file position, returning new position from start. | |
virtual FXlong | truncate (FXlong sz) |
Truncate file to size s. | |
virtual FXbool | flush () |
Flush to disk. | |
virtual FXint | eof () |
Test if we're at the end; -1 if error. | |
virtual FXlong | size () |
Return file size. | |
Public Member Functions inherited from FX::FXIODevice | |
FXIODevice () | |
Construct. | |
FXIODevice (FXInputHandle h) | |
Construct device and attach existing handle h. | |
FXInputHandle | handle () const |
Return handle. | |
virtual FXbool | isOpen () const |
Return true if open. | |
virtual FXuint | mode () const |
Return access mode. | |
virtual FXbool | mode (FXuint m) |
Change access mode of open device. | |
virtual FXuint | perms () const |
Return permissions. | |
virtual FXbool | perms (FXuint p) |
Set permissions. | |
virtual FXbool | attach (FXInputHandle h) |
Attach existing device handle, taking ownership of the handle. | |
virtual FXbool | detach () |
Detach device handle. | |
virtual FXival | readBlock (void *ptr, FXival count) |
Read block of bytes, returning number of bytes read. | |
virtual FXival | writeBlock (const void *ptr, FXival count) |
Write block of bytes, returning number of bytes written. | |
virtual FXbool | close () |
Close handle. | |
virtual | ~FXIODevice () |
Destroy and close. | |
Public Member Functions inherited from FX::FXIO | |
FXbool | readChar (FXchar &ch) |
Read character. | |
FXbool | writeChar (FXchar ch) |
Write character. | |
virtual | ~FXIO () |
Destroy and close. | |
Static Public Member Functions | |
static FXbool | create (const FXString &file, FXuint perm=FXIO::AllReadWrite) |
Create new (empty) file. | |
static FXbool | link (const FXString &srcfile, const FXString &dstfile) |
Link file. | |
static FXString | symlink (const FXString &file) |
Read symbolic link. | |
static FXbool | symlink (const FXString &srcfile, const FXString &dstfile) |
Symbolic link file. | |
static FXbool | identical (const FXString &file1, const FXString &file2) |
Return true if files are identical (identical node on disk) | |
static FXbool | copy (const FXString &srcfile, const FXString &dstfile, FXbool overwrite=false) |
Copy srcfile to dstfile, overwriting dstfile if allowed. | |
static FXbool | copyFiles (const FXString &srcfile, const FXString &dstfile, FXbool overwrite=false) |
Recursively copy files or directories from srcfile to dstfile, overwriting dstfile if allowed. | |
static FXbool | move (const FXString &srcfile, const FXString &dstfile, FXbool overwrite=false) |
Move or rename srcfile to dstfile, overwriting dstfile if allowed. | |
static FXbool | moveFiles (const FXString &srcfile, const FXString &dstfile, FXbool overwrite=false) |
Recursively copy or move files or directories from srcfile to dstfile, overwriting dstfile if allowed. | |
static FXbool | remove (const FXString &file) |
Remove file. | |
static FXbool | removeFiles (const FXString &path, FXbool recursive=false) |
Recursively remove file or directory, recurse if allowed. | |
static FXbool | concat (const FXString &srcfile1, const FXString &srcfile2, const FXString &dstfile, FXbool overwrite=false) |
Concatenate srcfile1 and srcfile2 to dstfile, overwriting dstfile if allowed. | |
Static Public Member Functions inherited from FX::FXIODevice | |
static FXbool | valid (FXInputHandle hnd) |
Check handle validity. | |
Additional Inherited Members | |
Public Types inherited from FX::FXIO | |
enum | { NoAccess = 0, ReadOnly = 1, WriteOnly = 2, ReadWrite = ReadOnly|WriteOnly, Append = 4, Truncate = 8, Create = 16, Exclusive = 32, NonBlocking = 64, Executable = 128, OwnHandle = 256, NoAccessTime = 512, Inheritable = 1024, Reading = ReadOnly, Writing = ReadWrite|Create|Truncate } |
Access modes. More... | |
enum | { Begin = 0, Current = 1, End = 2 } |
Positioning modes. More... | |
enum | { OtherExec = 0x00001, OtherWrite = 0x00002, OtherRead = 0x00004, OtherReadWrite = OtherRead|OtherWrite, OtherFull = OtherReadWrite|OtherExec, GroupExec = 0x00008, GroupWrite = 0x00010, GroupRead = 0x00020, GroupReadWrite = GroupRead|GroupWrite, GroupFull = GroupReadWrite|GroupExec, OwnerExec = 0x00040, OwnerWrite = 0x00080, OwnerRead = 0x00100, OwnerReadWrite = OwnerRead|OwnerWrite, OwnerFull = OwnerReadWrite|OwnerExec, AllRead = OtherRead|GroupRead|OwnerRead, AllWrite = OtherWrite|GroupWrite|OwnerWrite, AllExec = OtherExec|GroupExec|OwnerExec, AllReadWrite = AllRead|AllWrite, AllFull = AllReadWrite|AllExec, Hidden = 0x00200, Directory = 0x00400, File = 0x00800, SymLink = 0x01000, SetUser = 0x02000, SetGroup = 0x04000, Sticky = 0x08000, Character = 0x10000, Block = 0x20000, Socket = 0x40000, Fifo = 0x80000 } |
Permissions. More... | |
enum | { Error = -1, Again = -2, Broken = -3 } |
Error return codes for readBlock() and writeBlock() More... | |
Protected Attributes inherited from FX::FXIODevice | |
FXInputHandle | device |
Low level file access.
Copyright © 1997-2022 Jeroen van der Zijp |