home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / GPMsym / uxfiles.def < prev    next >
Text File  |  1996-10-10  |  5KB  |  134 lines

  1. (*
  2.  * =========== macro processed output from MPP  ==========
  3.  *
  4.  * input file  : uxfiles.dpp
  5.  * time stamp  : 1996 Aug 29 12:55:34
  6.  *
  7.  * output file : uxfiles.def
  8.  * created at  : 1996 Oct 10 16:21:31
  9.  *
  10.  * options ... :  -Dos2
  11.  *
  12.  * =======================================================
  13.  *)
  14.  
  15. (****************************************************************)
  16. (*                                                              *)
  17. (*         Gardens Point Modula-2 Library Definition            *)
  18. (*                                                              *)
  19. (*                                                              *)
  20. (*     (c) Copyright 1996 Faculty of Information Technology     *)
  21. (*              Queensland University of Technology             *)
  22. (*                                                              *)
  23. (*     Permission is granted to use, copy and change this       *)
  24. (*     program as long as the copyright message is left intact  *)
  25. (*                                                              *)
  26. (****************************************************************)
  27.  
  28. FOREIGN DEFINITION MODULE UxFiles;
  29.   IMPORT IMPLEMENTATION FROM "uxfiles.o";
  30.  
  31. (* This module provides the low level interface to the file system *)
  32.  
  33.  
  34. FROM SYSTEM   IMPORT ADDRESS, BYTE;
  35.  
  36. TYPE
  37.   File;
  38.   OpenMode = (ReadOnly, WriteOnly, ReadWrite, ReadOnlyText, WriteOnlyText,
  39.               ReadWriteText);
  40.   FilePermissionBits = 
  41.              (rdOnly, hidden, system, volId, subDir, archive);
  42.  
  43.   FileMode   = SET OF FilePermissionBits;
  44.   FileAttrib = FilePermissionBits;     (* synonyms for the WildCards *)
  45.   FileAttSet = FileMode;               (* library                    *) 
  46.  
  47. PROCEDURE GetMode(  name : ARRAY OF CHAR;
  48.         VAR mode : FileMode;
  49.         VAR done : BOOLEAN);
  50. (* precondition  : name must be a nul-terminated variable
  51.            array,or a literal string.
  52.    postcondition : if done then mode has permission bits *)
  53.  
  54. PROCEDURE SetMode(  name : ARRAY OF CHAR;
  55.             mode : FileMode;
  56.         VAR done : BOOLEAN);
  57. (* precondition  : name must be a nul-terminated variable
  58.            array,or a literal string.
  59.    postcondition : if done then file has permission bits *)
  60.  
  61. PROCEDURE Open(VAR f:    File;       (* Open an existing file *)
  62.                    name: ARRAY OF CHAR;
  63.                    mode: OpenMode;
  64.                VAR done: BOOLEAN);
  65.  
  66. PROCEDURE Create(VAR f:    File;     (* Open a new file *)
  67.                      name: ARRAY OF CHAR;
  68.                  VAR done: BOOLEAN);
  69.  
  70. PROCEDURE Close(VAR f:    File;      (* Close a file *)
  71.                 VAR done: BOOLEAN);
  72.  
  73. PROCEDURE Delete(str : ARRAY OF CHAR;
  74.              VAR ok  : BOOLEAN);
  75.  
  76. PROCEDURE Reset(f: File);
  77. (* Position the file at the beginning and set to "ReadMode"   *)
  78.  
  79. PROCEDURE ReadNBytes(    f:              File;
  80.                          buffPtr:        ADDRESS;
  81.                          requestedBytes: CARDINAL;
  82.                      VAR read:           CARDINAL);
  83.   (* Read requested bytes into buffer at address *)
  84.   (* 'buffPtr', number of effectively read bytes *)
  85.   (* is returned in 'read'                       *)
  86.  
  87. PROCEDURE WriteNBytes(    f:              File;
  88.                           buffPtr:        ADDRESS;
  89.                           requestedBytes: CARDINAL;
  90.                       VAR written:        CARDINAL);
  91.   (* Write requested bytes from buffer at address    *)
  92.   (* 'buffPtr', number of effectively written bytes  *)
  93.   (* is returned in 'written'                        *)
  94.  
  95. PROCEDURE ReadByte(    f: File;      (* Read a byte from file *)
  96.                    VAR b: BYTE);
  97.  
  98. PROCEDURE WriteByte( f: File;     (* Write a word to file *)
  99.                      b: BYTE);
  100.  
  101. PROCEDURE EndFile( f : File) : BOOLEAN;
  102.   (* returns true if an attempt has been made
  103.      to read past the physical end of file   *)
  104.  
  105. PROCEDURE GetPos(   f : File;
  106.         VAR p : CARDINAL);
  107.  
  108. PROCEDURE SetPos( f : File;
  109.           p : CARDINAL);
  110.   (* GetPos and SetPos get and set the file position *)
  111.  
  112. PROCEDURE AccessTime(path     : ARRAY OF CHAR;
  113.              VAR time : CARDINAL;
  114.              VAR ok   : BOOLEAN);
  115.   (* finds time of last access to named file *)
  116.  
  117. PROCEDURE ModifyTime(path     : ARRAY OF CHAR;
  118.              VAR time : CARDINAL;
  119.              VAR ok   : BOOLEAN);
  120.   (* finds time of last modification to file *)
  121.  
  122. PROCEDURE StatusTime(path     : ARRAY OF CHAR;
  123.              VAR time : CARDINAL;
  124.              VAR ok   : BOOLEAN);
  125.   (* finds time of last status change of file *)
  126.  
  127.  
  128. PROCEDURE FileSize(filePath  : ARRAY OF CHAR;
  129.            VAR size  : CARDINAL;
  130.            VAR ok    : BOOLEAN);
  131.   (* gets size of file "filePath" and returns it in "size" *)
  132.  
  133. END UxFiles.
  134.