CFile Class


The CFile class encapsulates file operations. This class wraps several C functions for working with text and binary files.

Usage

Construction

Object = CFile:new()

Destruction

Object:delete()

Data Members

The data members in the table below may be safely read by the script. These data members are initialized by the Open method and they should not be directly written by your script.

  

sPath

The path name for the file.

sAccess

The file access mode string

Methods

Construction

new

Creates a new instance of a CFile object.

delete

Deletes the instance of the CFile object.

Operations

Close

Closes the file.

FilePos

Returns the current file position.

Flush

Commits data in the operating system buffer to the file.

Open

Opens the file.

Printf

Writes formatted text to the file.

Seek

Resets the file position to a given location.

Data Member Access

GetPath

Returns the name of the file.

Related Topics

Printf, CFindFiles