File interface


Section contents


Overview

Defined in

cfile.oxh

Description

<TBS>


Construction / destruction


NewFile - Constructor

Usage

this& = NewFile&:

Description

Creates a file interface object and returns a handle which allows the object to be manipulated.

Return Value
this& An value which represents the created file interface
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.

Example
  LOCAL this&

  this& = NewFile&:
  DeleteFile:(this&) 

DeleteFile - Destructor

Usage

DeleteFile:(BYREF this&)

Description

Destroys the file interface object.

Arguments
BYREF this& A handle to a file interface object
Example
  LOCAL this&

  this& = NewFile&:
  DeleteFile:(this&) 

Methods provided


FileAtt - file attributes

Usage

err% = FileAtt%:(this&,BYREF attributes&)

Description

Get the file attributes.

Arguments
this& A handle to a file interface object
BYREF attributes& The file attributes
Return value
err% An error code
See also

FileSetAtt


FileChangeMode - change file share mode

Usage

err% = FileChangeMode%:(this&,mode&)

Description

Chnage the file access mode.

Arguments
this& A handle to a file interface object
mode& The new file acces mode
Return value
err% An error code

FileClose - file close

Usage

FileClose:(this&)

Description

Close the file.

Arguments
this& A handle to a file interface object

FileCreate - create a file

Usage

err% = FileCreate%:(this&,fs&,name$,mode&)

Description

Create a new file.

Arguments
this& A handle to a file interface object
fs& A handle to a file server object
name$ The name of the file to create
mode& The mode of the file opened
Return value
err% An error code
See also

FileOpen, FileReplace, FileTemp


FileFlush - flush data to storage device

Usage

err% = FileFlush%:(this&)

Description

Flushes the data in the internal buffers to the storage device.

Arguments
this& A handle to a file interface object
Return value
err% An error code

FileLock - lock a range of bytes

Usage

err% = FileLock%:(this&,pos&,length&)

Description

Locks the bytes starting at pos& for length& bytes.

Arguments
this& A handle to a file interface object
pos& Offet from start of file
length& Number of bytes to lock
Return value
err% An error code
See also

FileUnLock


FileModified - file modification time

Usage

err% = FileModified%:(this&,time&)

Description

Gets the file modification time..

Arguments
this& A handle to a file interface object
time& A handle to a time object
Return value
err% An error code
See also

FileSetModified


FileOpen - open a file

Usage

err% = FileOpen%:(this&,fs&,name$,mode&)

Description

Open an existing file.

Arguments
this& A handle to a file interface object
fs& A handle to a file server object
name$ The name of the file to open
mode& The mode of the file opened
Return value
err% An error code
See also

FileCreate, FileReplace, FileTemp


FileRead - read from file

Usage

err% = FileRead%:(this&,des&)

Description

Read from file.

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
Return value
err% An error code
See also

FileReadA, FileReadLen, FileReadLenA, FileReadPos, FileReadPosA, FileReadPosLen, FileReadPosLenA


FileReadA - read from file (asynchronous)

Usage

FileReadA:(this&,des&,BYREF status&)

Description

Asynchronous read from file

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileRead, FileReadLen, FileReadLenA, FileReadPos, FileReadPosA, FileReadPosLen, FileReadPosLenA


FileReadLen - read from file

Usage

err% = FileReadLen%:(this&,des&,length&)

Description

Read from file.

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
length& The number of bytes to read
Return value
err% An error code
See also

FileRead, FileReadA, FileReadLenA, FileReadPos, FileReadPosA, FileReadPosLen, FileReadPosLenA


FileReadLenA - read from file (asynchronous)

Usage

FileReadLenA:(this&,des&,length&,BYREF status&)

Description

Asynchronous read from file

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
length& The number of bytes to read
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileRead, FileReadA, FileReadLen, FileReadPos, FileReadPosA, FileReadPosLen, FileReadPosLenA


FileReadPos - read from file

Usage

err% = FileReadPos%:(this&,pos&,des&)

Description

Read from file.

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
Return value
err% An error code
See also

FileRead, FileReadA, FileReadLen, FileReadLenA, FileReadPosA, FileReadPosLen, FileReadPosLenA


FileReadPosA - read from file (asynchronous)

Usage

FileReadPosA:(this&,pos&,des&,BYREF status&)

Description

Asynchronous read from file

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileRead, FileReadA, FileReadLen, FileReadLenA, FileReadPos, FileReadPosLen, FileReadPosLenA


FileReadPosLen - read from file

Usage

err% = FileReadPosLen%:(this&,pos&,des&,length&)

Description

Read from file.

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
length& The number of bytes to read
Return value
err% An error code
See also

FileRead, FileReadA, FileReadLen, FileReadLenA, FileReadPos, FileReadPosA, FileReadPosLenA


FileReadPosLenA - read from file (asynchronous)

Usage

FileReadPosLenA:(this&,pos&,des&,length&,BYREF status&)

Description

Asynchronous read from file

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
length& The number of bytes to read
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileRead, FileReadA, FileReadLen, FileReadLenA, FileReadPos, FileReadPosA, FileReadPosLen


FileRename - rename open file

Usage

err% = FileRename%:(this&,name$)

Description

Rename an open file.

Arguments
this& A handle to a file interface object
name$ The name of the file to create
Return value
err% An error code

FileReplace - replace a file

Usage

err% = FileReplace%:(this&,fs&,name$,mode&)

Description

Replace a file.

Arguments
this& A handle to a file interface object
fs& A handle to a file server object
name$ The name of the file to create
mode& The mode of the file opened
Return value
err% An error code
See also

FileCreate, FileOpen, FileTemp


FileSeek - set/get current file position

Usage

err% = FileSeek%:(this&,mode&,BYREF pos&)

Description

Seek to the position pos& according to the operation mode&..

Arguments
this& A handle to a file interface object
mode& The seek operation to perform
BYREF pos& The offset to perform the seek operation
Return value
err% An error code

FileSet - set file attributes and modification time

Usage

err% = FileSet%:(this&,time&,set&,clear&)

Description

Set the attributes in set& and clear the attributes in clear& and also sets the modification time to time&..

Arguments
this& A handle to a file interface object
time& A handle to a time object
set& A mask of the attributes to set
clear& A mask of the attributes to clear
Return value
err% An error code
See also

FileAtt, FileModified, FileSetAtt, FileSetModified


FileSetAtt - set file attributes

Usage

err% = FileSetAtt%:(this&,set&,clear&)

Description

Set the attributes in set& and clear the attributes in clear&..

Arguments
this& A handle to a file interface object
set& A mask of the attributes to set
clear& A mask of the attributes to clear
Return value
err% An error code
See also

FileAtt, FileSet


FileSetModifiedAtt - set file modification time

Usage

err% = FileSetModified%:(this&,time&)

Description

Set the file modification time to that in time&..

Arguments
this& A handle to a file interface object
time& A handle to a time object
Return value
err% An error code
See also

FileModifiedt, FileSet


FileSetSize - set size of file

Usage

err% = FileSetSize%:(this&,size&)

Description

Changes the size of the file to size&.

Arguments
this& A handle to a file interface object
size& The new size of the file
Return value
err% An error code
See also

FileSize


FileSize - size of file

Usage

err% = FileSize%:(this&,BYREF size&)

Description

get the size of the file.

Arguments
this& A handle to a file interface object
BYREF size& The size of the file
Return value
err% An error code
See also

FileSetSize


FileTemp - open a temporary file

Usage

err% = FileTemp%:(this&,fs&,name$,des&,mode&)

Description

Replace a file.

Arguments
this& A handle to a file interface object
fs& A handle to a file server object
name$ The name of the file to create
des& A handle to a descriptor object which contains the name of the created file
mode& The mode of the file opened
Return value
err% An error code
See also

FileCreate, FileOpen, FileReplace


FileUnLock - unlock a range of bytes

Usage

err% = FileUnLock%:(this&,pos&,length&)

Description

Unlocks the bytes starting at pos& for length& bytes.

Arguments
this& A handle to a file interface object
pos& Offet from start of file
length& Number of bytes to unlock
Return value
err% An error code
See also

FileLock


FileWrite - write to file

Usage

err% = FileWrite%:(this&,des&)

Description

Write to file.

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
Return value
err% An error code
See also

FileWriteA, FileWriteLen, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWriteA - write to file (asynchronous)

Usage

FileWriteA:(this&,des&,BYREF status&)

Description

Asynchronous write to file

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileWrite, FileWriteLen, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWriteStr - write to file

Usage

err% = FileWrite%:(this&,str$)

Description

Write to file.

Arguments
this& A handle to a file interface object
str$ A string to write
Return value
err% An error code
See also

FileWriteA, FileWriteLen, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWriteLen - write to file

Usage

err% = FileWriteLen%:(this&,des&,length&)

Description

Write to file.

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
length& The number of bytes to write
Return value
err% An error code
See also

FileWrite, FileWriteA, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWriteLenA - write from file (asynchronous)

Usage

FileWriteLenA:(this&,des&,length&,BYREF status&)

Description

Asynchronous write to file

Arguments
this& A handle to a file interface object
des& A handle to a descriptor object
length& The number of bytes to write
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileWrite, FileWriteA, FileWriteLen, FileWritePos, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWriteLenStr - write to file

Usage

err% = FileWriteLenStr%:(this&,str$,length&)

Description

Write to file.

Arguments
this& A handle to a file interface object
str$ A string to write
length& The number of bytes to write
Return value
err% An error code
See also

FileWrite, FileWriteA, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWritePos - write to file

Usage

err% = FileWritePos%:(this&,pos&,des&)

Description

Write to file.

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
Return value
err% An error code
See also

FileWrite, FileWriteA, FileWriteLen, FileWriteLenA, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWritePosA - write to file (asynchronous)

Usage

FileWritePosA:(this&,pos&,des&,BYREF status&)

Description

Asynchronous write to file

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileWrite, FileWriteA, FileWriteLen, FileWriteLenA, FileWritePos, FileWritePosLen, FileWritePosLenA


FileWritePosStr - write to file

Usage

err% = FileWritePosStr%:(this&,pos&,str$)

Description

Write to file.

Arguments
this& A handle to a file interface object
pos& Offset from start of file
str$ A string to write
Return value
err% An error code
See also

FileWrite, FileWriteA, FileWriteLen, FileWriteLenA, FileWritePosA, FileWritePosLen, FileWritePosLenA


FileWritePosLen - write to file

Usage

err% = FileWritePosLen%:(this&,pos&,des&,length&)

Description

Write to file.

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
length& The number of bytes to write
Return value
err% An error code
See also

FileWrite, FileWriteA, FileWriteLen, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLenA


FileWritePosLenA - write to file (asynchronous)

Usage

FileWritePosLenA:(this&,pos&,des&,length&,BYREF status&)

Description

Asynchronous write to file

Arguments
this& A handle to a file interface object
pos& Offset from start of file
des& A handle to a descriptor object
length& The number of bytes to write
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

See also

FileWrite, FileWriteA, FileWriteLen, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLen


FileWritePosLenStr - write to file

Usage

err% = FileWritePosLenStr%:(this&,pos&,str$,length&)

Description

Write to file.

Arguments
this& A handle to a file interface object
pos& Offset from start of file
str$ A strin to write
length& The number of bytes to write
Return value
err% An error code
See also

FileWrite, FileWriteA, FileWriteLen, FileWriteLenA, FileWritePos, FileWritePosA, FileWritePosLenA