546 #include "msos/ptlib/file.h"
548 #include "unix/ptlib/file.h"
553 #endif // PTLIB_FILE_H
virtual PBoolean Close()
Close the file channel.
virtual PBoolean Read(void *buf, PINDEX len)
Low level read from the file channel.
const PFilePath & GetFilePath() const
Get the full path name of the file.
File open fails if file already exists.
Definition: file.h:103
This class represents a disk file.
Definition: file.h:60
virtual PBoolean Open(OpenMode mode=ReadWrite, int opts=ModeDefault)
Open the current file in the specified mode and with the specified options.
virtual off_t GetLength() const
Get the current size of the file.
File may not be read by another process.
Definition: file.h:107
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
File may not be written by another process.
Definition: file.h:109
File can be both read and written.
Definition: file.h:80
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:1184
virtual PBoolean SetPosition(off_t pos, FilePositionOrigin origin=Start)
Set the current active position in the file for the next read or write operation. ...
File can be read but not written.
Definition: file.h:78
static PBoolean Access(const PFilePath &name, OpenMode mode)
Check for file access modes.
PBoolean removeOnClose
File is to be removed when closed.
Definition: file.h:541
BOOL PBoolean
Definition: object.h:102
static PBoolean Remove(const PFilePath &name, PBoolean force=false)
Delete the specified file.
static PBoolean Copy(const PFilePath &oldname, const PFilePath &newname, PBoolean force=false)
Make a copy of the specified file.
Set position relative to current file position.
Definition: file.h:461
virtual PBoolean Write(const void *buf, PINDEX len)
Low level write to the file channel.
Abstract class defining I/O channel semantics.
Definition: channel.h:107
FilePositionOrigin
Options for the origin in setting the file position.
Definition: file.h:457
static PBoolean Move(const PFilePath &oldname, const PFilePath &newname, PBoolean force=false)
Move the specified file.
File open fails if file does not exist.
Definition: file.h:97
File can be written but not read.
Definition: file.h:79
virtual off_t GetPosition() const
Get the current active position in the file for the next read or write operation. ...
PFile()
Create a file object but do not open it.
The character string class.
Definition: pstring.h:108
void SetFilePath(const PString &path)
Set the full path name of the file.
File options depend on the OpenMode parameter.
Definition: file.h:95
static PBoolean GetInfo(const PFilePath &name, PFileInfo &info)
Get information (eg protection, timestamps) on the specified file.
Set position relative to end of file.
Definition: file.h:463
PFilePath path
The fully qualified path name for the file.
Definition: file.h:540
static PBoolean Rename(const PFilePath &oldname, const PString &newname, PBoolean force=false)
Change the specified files name.
PBoolean Exists() const
Check for file existance.
File is created if it does not exist.
Definition: file.h:99
PBoolean IsEndOfFile() const
Determine if the current file position is at the end of the file.
~PFile()
Close the file on destruction.
virtual PString GetName() const
Get the platform and I/O channel type name of the channel.
Set position relative to start of file.
Definition: file.h:459
virtual PBoolean SetLength(off_t len)
Set the size of the file, padding with 0 bytes if it would require expanding the file, or truncating it if being made shorter.
OpenOptions
When a file is opened, a number of options may be associated with the open file.
Definition: file.h:93
Class containing the system information on a file path.
Definition: pdirect.h:63
static PBoolean SetPermissions(const PFilePath &name, int permissions)
Set permissions on the specified file.
File is temporary and is to be deleted when closed.
Definition: file.h:105
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
Comparison Compare(const PObject &obj) const
Determine the relative rank of the two objects.
OpenMode
When a file is opened, it may restrict the access available to operations on the object instance...
Definition: file.h:77
File is set to zero length if it already exists.
Definition: file.h:101