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 >
Text File  |  1991-02-21  |  4KB  |  168 lines

  1. #output Force Tools 1.1 - Low level i/o functions
  2.  
  3. *--- check if a drive is a network drive
  4. function logical net_drive prototype
  5.    params value byte drive_no
  6.  
  7. *--- dupplicate filehandle (std i/o redirection)
  8. function uint fb_dup prototype
  9.    params value uint fh_source, value uint fh_target
  10.  
  11. * result 0 means ok
  12.  
  13. *--- get / set volume label
  14. function logical volume_label prototype
  15.    params value byte drive, char volume_name, value logical read_write   
  16.  
  17. *--- note : drive a = 0, b = 1 etc.
  18.  
  19. ***********************
  20. * Fopen(<CHAR>, <UINT>)
  21. *
  22. * Open a binary/Text file
  23. * and return a file handle (-1 error occured)
  24. *
  25. * Para 2 : access mode
  26. *          00  read only
  27. *          01  write only
  28. *          02  read/write
  29. *
  30. FUNCTION INT Fopen PROTOTYPE
  31.    PARAMS CONST CHAR , VALUE UINT
  32.    
  33. *****************************
  34. * Fread(<UINT>, <CHAR>, <INT>
  35. *
  36. * Read a number of bytes in a 
  37. * buffer from a file
  38. *
  39. * Para 1 : File Handle
  40. * Para 2 : Buffer to receive bytes
  41. * Para 3 : Number of bytes to read
  42. * Ret    : The number of bytes succesfully read
  43. *
  44. FUNCTION INT Fread PROTOTYPE
  45.    PARAMS VALUE UINT, CHAR, VALUE INT
  46.    
  47. ******************************
  48. * Fseek(<UINT>, <INT>, <UINT>)
  49. *
  50. * Move file pointer
  51. *
  52. * Para 1 : File handle
  53. * Para 2 : Number of bytes to move (-=Backward movement)
  54. * Para 3 :  method
  55. *           00 offset from beginning of file
  56. *           01 offset from present location
  57. *           02 offset from end of file
  58. *
  59. FUNCTION INT Fseek PROTOTYPE
  60.    PARAMS VALUE UINT, VALUE INT, VALUE UINT
  61.    
  62. *******************************
  63. * Fwrite(<UINT>, <CHAR>, <INT>)
  64. *
  65. * Write a number of bytes from 
  66. * a buffer to a file
  67. *
  68. * Para 1 : File Handle
  69. * Para 2 : Buffer to write        
  70. * Para 3 : Number of bytes to write
  71. * Ret    : Error code
  72. *
  73. FUNCTION INT Fwrite PROTOTYPE
  74.    PARAMS VALUE UINT, CONST CHAR, VALUE INT
  75.    
  76. ****************
  77. * Fclose(<UINT>)
  78. *
  79. * Close a file with a file handle
  80. * Return .T. if ok
  81. *
  82. FUNCTION LOGICAL Fclose PROTOTYPE
  83.    PARAMS VALUE UINT
  84.    
  85. *************************
  86. * Fcreate(<CHAR>, <UINT>)
  87. *
  88. * Create a new file or truncate
  89. * a existing one to 0 bytes
  90. *
  91. * Para 1 : Filename
  92. * Para 2 : Attributes
  93. *          bit 0: read-only
  94. *              1: hidden
  95. *              2: system
  96. *              3: volume label (ignored)
  97. *              4: reserved, must be zero (directory)
  98. *              5: archive bit
  99. *              7: if set, file is shareable under Novell NetWare 
  100. *
  101. FUNCTION INT Fcreate PROTOTYPE
  102.    PARAMS CONST CHAR, VALUE UINT
  103.    
  104. *********************
  105. * Ferror()
  106. *
  107. * Return errorcode of last
  108. * low level I/O F-Function
  109. *
  110. FUNCTION UINT Ferror PROTOTYPE
  111.  
  112. ******************************
  113. * Fattrib(<CHAR>, <L>, <UINT>)
  114. *
  115. * Get / Set file attributes
  116. *
  117. * Para 1 : Filename
  118. * Para 2 : .T. = Get attributes, .F. = Set
  119. * Para 3 : file attribute bits
  120. *          bit 0 = read only
  121. *          1 = hidden file
  122. *          2 = system file
  123. *          3 = volume label
  124. *          4 = subdirectory
  125. *          5 = written since backup ("archive" bit)
  126. *          8 = shareable (Novell NetWare)
  127. *
  128. FUNCTION INT Fattrib PROTOTYPE
  129.    PARAMS CONST CHAR, VALUE LOGICAL, VALUE UINT
  130.  
  131. ***********************************
  132. * Ftemp(<CHAR>)
  133. *
  134. * Create a unique (Temporary) file
  135. *
  136. * Para 1 : Path ending with a '\' + 13 bytes
  137. *          to receive filename
  138. * Ret    : File Handle, File name in <CHAR>
  139. *
  140. FUNCTION INT Ftemp PROTOTYPE
  141.    PARAMS CHAR
  142.  
  143. **********************
  144. * FlockFl(<UINT>, <L>)
  145. *
  146. * Lock a complete file
  147. * Para 1 : File Handle
  148. * Para 2 : .T. = Lock, .F. = UnLock
  149. * Ret    : .T. if succesfull
  150. *
  151. FUNCTION LOGICAL FlockFl PROTOTYPE
  152.    PARAMS VALUE UINT, VALUE LOGICAL
  153.  
  154. **************************************
  155. * FlockPt(<UINT>, <L>, <UINT>, <UINT>)
  156. *
  157. * Lock part of a file
  158. *
  159. * Para 1 : File Handle
  160. * Para 2 : .T. = Lock, .F. = UnLock
  161. * Para 3 : offset in file
  162. * Para 4 : Number of bytes to lock
  163. *
  164. FUNCTION LOGICAL FlockPt PROTOTYPE
  165.    PARAMS VALUE UINT, VALUE LOGICAL, VALUE UINT, VALUE UINT
  166.    
  167. * oef - fc_lowio.hdr