home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / mag&info / msjv7_4.zip / OPEN.ARJ / FILE_IO.H < prev    next >
Text File  |  1992-07-01  |  3KB  |  68 lines

  1.  
  2. extern unsigned char DosMajVer, DosMinVer;
  3.  
  4. typedef unsigned char  BYTE;
  5. typedef unsigned char  FLAG;
  6.  
  7. // O_COMMIT only works in DOS 4.0 & up.  For commit on pre DOS 4 call
  8. // FileCommit.
  9.  
  10. // O_CREATE will create a file ONLY if it doesn't exist.  To force a
  11. // create, use "O_CREATE | O_OPEN | O_TRUNC".
  12.  
  13. // If O_TEMP is set, the file name is the directory to create the file in.
  14. // Will copy the final name into pFile - make sure its long enough (extra
  15. // 12 bytes).  If O_TEMP is set, O_OPEN & O_CREATE are ignored.
  16.  
  17. // At least one of O_READ and O_WRITE must be set.
  18.  
  19. // If you do NOT use S_DENY_READ and/or S_DENY_WRITE - the file will be
  20. // opened in DENY_NONE, NOT compatibility mode.  For pre DOS 4, to get the
  21. // sharing set on a create, the file will be created, closed, and then
  22. // opened.
  23.  
  24.  
  25. #define     O_OPEN       0x0001       // Open the file
  26. #define     O_CREATE     0x0002       // Create the file if doesn't exist
  27. #define     O_TEMP       0x0004       // Open a temporary file
  28.  
  29. #define     O_READ       0x0010       // Can read from the file
  30. #define     O_WRITE      0x0020       // Can write to the file
  31.  
  32. #define     O_APPEND     0x0100       // seek to end of file
  33. #define     O_TRUNC      0x0200       // set file to 0 length
  34. #define     O_COMMIT     0x0400       // set file to write-through
  35.  
  36. #define     S_DENY_READ  0x1000       // lock out other reads
  37. #define     S_DENY_WRITE 0x2000       // lock out other writes
  38. #define     S_DENY_CHILD 0x4000       // don't pass handle to child
  39.  
  40. #define     A_READ_ONLY  0x01        // Create file attributes
  41. #define     A_HIDDEN     0x02
  42. #define     A_SYSTEM     0x04
  43. #define     A_ARCHIVE    0x20
  44.  
  45.  
  46. #ifdef   DEBUG
  47.  
  48. void  DebugPrintf (char const *, ...);
  49.  
  50. #endif
  51.  
  52. unsigned FileClose(int hFil);
  53. unsigned FileCloseTemp(int hFil,BYTE const *pFile);
  54. unsigned FileCommit(int hFil,int fOpenCommit);
  55. unsigned FileDelete(BYTE const *pFile);
  56. int            FileDup(int hFil);
  57. unsigned long FileGetSize(int hFil);
  58. int FileOpen(BYTE *pFile,unsigned uMode,unsigned uAtr,
  59.              unsigned *puErr);
  60. int FileOpenTemp(BYTE *pFile,unsigned long lNum);
  61. unsigned FileRead(int hFil,void *pBuf,unsigned uNum);
  62. unsigned FileSeek(int hFil,unsigned long ulOffset);
  63. unsigned FileSeekRead(int hFil,unsigned long ulOffset,void *pBuf,unsigned uNum);
  64. unsigned FileSeekWrite(int hFil,unsigned long ulOffset,void const *pBuf,unsigned uNum);
  65. unsigned FileSetSize(int hFil,unsigned long ulSize);
  66. unsigned FileTrueName(BYTE const *pFile,BYTE *pTrue);
  67. unsigned FileWrite(int hFil,void const *pBuf,unsigned uNum);
  68.