home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 11 / AUCD11B.iso / LANGUAGES / WraithSet / AwkStuff / GawkSrc / Docs / Riscos < prev   
Text File  |  1999-11-06  |  1KB  |  39 lines

  1. ******  Extra builtin functions for RISC OS version ********
  2.  
  3.  
  4. sysvar(s)
  5.           returns the string value of the system variable s, and causes
  6.           an error if the variable is undefined.
  7.  
  8. filetype(f)
  9.             returns the numeric value of the filetype of file f.
  10.             It returns -1 if the file does not exist or has no type.
  11.             It returns 0x1000 if f is a directory, and
  12.             0x2000 if it is an application.
  13.             This function cannot be used on a file that is open.
  14.  
  15.   So for example
  16.  
  17.   function filetypestring(f, type) {
  18.       if ((type = exists(f)) == 0) return ""
  19.       if (type == 2) return "directory"
  20.       if (type == 3) return "image file"
  21.       return sysvar("File$Type_" sprintf("%3x",filetype(f)))  }
  22.  
  23.   gives the filetype as a string, if defined.
  24.  
  25. exists(f)
  26.           returns 0 if f does not exist
  27.                   1 if f is a file
  28.                   2 if f is a directory
  29.                   3 if f is an image file
  30.            This function cannot be used on a file that is open.
  31.  
  32. later(f1,f2)
  33.          returns 1 if the datestamp of file f1 is later than
  34.          that of f2 and 0 otherwise.
  35.  
  36.  -------------------------------------------------------------------
  37. G.C.Wraith  15/9/99
  38. mailto:gavin@wraith.u-net.com
  39. http://www.wraith.u-net.com