home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
FOXPRO
/
FCT1_12
/
FC_LOWIO.HDR
< prev
next >
Wrap
Text File
|
1991-02-21
|
4KB
|
168 lines
#output Force Tools 1.1 - Low level i/o functions
*--- check if a drive is a network drive
function logical net_drive prototype
params value byte drive_no
*--- dupplicate filehandle (std i/o redirection)
function uint fb_dup prototype
params value uint fh_source, value uint fh_target
* result 0 means ok
*--- get / set volume label
function logical volume_label prototype
params value byte drive, char volume_name, value logical read_write
*--- note : drive a = 0, b = 1 etc.
***********************
* Fopen(<CHAR>, <UINT>)
*
* Open a binary/Text file
* and return a file handle (-1 error occured)
*
* Para 2 : access mode
* 00 read only
* 01 write only
* 02 read/write
*
FUNCTION INT Fopen PROTOTYPE
PARAMS CONST CHAR , VALUE UINT
*****************************
* Fread(<UINT>, <CHAR>, <INT>
*
* Read a number of bytes in a
* buffer from a file
*
* Para 1 : File Handle
* Para 2 : Buffer to receive bytes
* Para 3 : Number of bytes to read
* Ret : The number of bytes succesfully read
*
FUNCTION INT Fread PROTOTYPE
PARAMS VALUE UINT, CHAR, VALUE INT
******************************
* Fseek(<UINT>, <INT>, <UINT>)
*
* Move file pointer
*
* Para 1 : File handle
* Para 2 : Number of bytes to move (-=Backward movement)
* Para 3 : method
* 00 offset from beginning of file
* 01 offset from present location
* 02 offset from end of file
*
FUNCTION INT Fseek PROTOTYPE
PARAMS VALUE UINT, VALUE INT, VALUE UINT
*******************************
* Fwrite(<UINT>, <CHAR>, <INT>)
*
* Write a number of bytes from
* a buffer to a file
*
* Para 1 : File Handle
* Para 2 : Buffer to write
* Para 3 : Number of bytes to write
* Ret : Error code
*
FUNCTION INT Fwrite PROTOTYPE
PARAMS VALUE UINT, CONST CHAR, VALUE INT
****************
* Fclose(<UINT>)
*
* Close a file with a file handle
* Return .T. if ok
*
FUNCTION LOGICAL Fclose PROTOTYPE
PARAMS VALUE UINT
*************************
* Fcreate(<CHAR>, <UINT>)
*
* Create a new file or truncate
* a existing one to 0 bytes
*
* Para 1 : Filename
* Para 2 : Attributes
* bit 0: read-only
* 1: hidden
* 2: system
* 3: volume label (ignored)
* 4: reserved, must be zero (directory)
* 5: archive bit
* 7: if set, file is shareable under Novell NetWare
*
FUNCTION INT Fcreate PROTOTYPE
PARAMS CONST CHAR, VALUE UINT
*********************
* Ferror()
*
* Return errorcode of last
* low level I/O F-Function
*
FUNCTION UINT Ferror PROTOTYPE
******************************
* Fattrib(<CHAR>, <L>, <UINT>)
*
* Get / Set file attributes
*
* Para 1 : Filename
* Para 2 : .T. = Get attributes, .F. = Set
* Para 3 : file attribute bits
* bit 0 = read only
* 1 = hidden file
* 2 = system file
* 3 = volume label
* 4 = subdirectory
* 5 = written since backup ("archive" bit)
* 8 = shareable (Novell NetWare)
*
FUNCTION INT Fattrib PROTOTYPE
PARAMS CONST CHAR, VALUE LOGICAL, VALUE UINT
***********************************
* Ftemp(<CHAR>)
*
* Create a unique (Temporary) file
*
* Para 1 : Path ending with a '\' + 13 bytes
* to receive filename
* Ret : File Handle, File name in <CHAR>
*
FUNCTION INT Ftemp PROTOTYPE
PARAMS CHAR
**********************
* FlockFl(<UINT>, <L>)
*
* Lock a complete file
*
* Para 1 : File Handle
* Para 2 : .T. = Lock, .F. = UnLock
* Ret : .T. if succesfull
*
FUNCTION LOGICAL FlockFl PROTOTYPE
PARAMS VALUE UINT, VALUE LOGICAL
**************************************
* FlockPt(<UINT>, <L>, <UINT>, <UINT>)
*
* Lock part of a file
*
* Para 1 : File Handle
* Para 2 : .T. = Lock, .F. = UnLock
* Para 3 : offset in file
* Para 4 : Number of bytes to lock
*
FUNCTION LOGICAL FlockPt PROTOTYPE
PARAMS VALUE UINT, VALUE LOGICAL, VALUE UINT, VALUE UINT
* oef - fc_lowio.hdr