class PFile |
This class represents a disk file.
![]() | Construction |
![]() | Overrides from class PObject |
![]() | Overrides from class PChannel |
![]() | File manipulation functions |
![]() | File channel functions |
![]() | path The fully qualified path name for the file |
![]() | removeOnClose File is to be removed when closed |
Information functions
Reading functions
Writing functions
Miscellaneous functions
Error functions
Run Time Type functions
I/O functions
Comparison functions
This class represents a disk file. This is a particular type of I/O channel that has certain attributes. All platforms have a disk file, though exact details of naming convertions etc may be different.The basic model for files is that they are a named sequence of bytes that persists within a directory structure. The transfer of data to and from the file is made at a current position in the file. This may be set to random locations within the file.
The ModeDefault option will use the following values:
Mode | Options |
ReadOnly | MustExist |
WriteOnly | Create | Truncate |
ReadWrite | Create |
The PChannel::IsOpen() function may be used after object construction to determine if the file was successfully opened.
The PChannel::IsOpen() function may be used after object construction to determine if the file was successfully opened.
The GetErrorCode() function should be consulted after Read() returns FALSE to determine what caused the failure.
The GetErrorCode() function should be consulted after Write() returns FALSE to determine what caused the failure.
The newname parameter must consist only of the file name part, as returned by the PFilePath::GetFileName() function. Any other file path parts will cause an error.
The first form uses the file path specification associated with the instance of the object. The name within the instance is changed to the new name if the function succeeds. The second static function uses an arbitrary file specified by name.
The newname parameter must consist only of the file name part, as returned by the PFilePath::GetFileName() function. Any other file path parts will cause an error.
The first form uses the file path specification associated with the instance of the object. The name within the instance is changed to the new name if the function succeeds. The second static function uses an arbitrary file specified by name.
If there has not been a filename attached to the file object (via SetFilePath(), the name parameter or a previous open) then a new unique temporary filename is generated.
Note: if mode is StandardInput, StandardOutput or StandardError, then the name parameter is ignored.
Alphabetic index HTML hierarchy of classes or Java