home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1997 / ARCHIVE_97.iso / discs / mag_discs / volume_08 / issue_06 / risc_os / FileSwitch < prev    next >
Text File  |  1988-07-20  |  5KB  |  187 lines

  1. > net#arf:&.doc*.FileSwitch
  2.  
  3. FS level changes since 1.20
  4. ===========================
  5.  
  6. new bits/fields in fsinfo word
  7.  
  8. fsinfo_flushnotify      * 1 :SHL: 27    ; Tell filing system when flushing
  9. fsinfo_fsfilereadinfonolen * 1 :SHL: 26 ; fsfile_ReadInfoNoLen supported
  10. fsinfo_fileinfo         * 1 :SHL: 25    ; fsfunc_FileInfo supported
  11. fsinfo_setcontexts      * 1 :SHL: 24    ; fsfunc_SetContexts supported
  12.                                         ; ^^^Don't know if this should be doc'd
  13.  
  14. fsinfo_nfiles           * &FF :SHL: 8   ; Min number of files openable on fs
  15.                                         ; 0 -> unlimited by fs
  16.  
  17. fsargs
  18. ------
  19.  
  20. In      r0 = fsargs_Flush
  21.         r1 = fs handle
  22.  
  23. Gives filesystem notification of a flush to media
  24.  
  25. Only needed where filesystem does buffering in addition to FileSwitch, eg.
  26. ADFS when doing readahead/writebehind.
  27.  
  28. Only called if fsinfo_flushnotify is set in fsinfo word and stream is buffered.
  29.  
  30.  
  31. fsfile
  32. ------
  33.  
  34. In      r0 = fsfunc_ReadInfoNoLen
  35.         r1 -> filename
  36.  
  37. Out     r0 = object type
  38.         r2 = load addr
  39.         r3 = exec addr
  40.         r5 = attr
  41.  
  42. Much like fsfunc_ReadInfo, but don't require length. Useful for NetFS with
  43. FileServers as length is not stored in directory. NB. There is no high-level
  44. equivalent of this call.
  45.  
  46. Only called if fsinfo_fsfilereadinfonolen is set in fsinfo word, otherwise
  47. called with fsfile_ReadInfo, and returned r4 is ignored.
  48.  
  49.  
  50. fsfunc
  51. ------
  52.  
  53. This WAS present at the low-level interface in 1.20 but not documented.
  54.  
  55. In      r0 = fsfunc_CatalogObjects (10_xx)
  56.         r1 -> dirname
  57.         r2 -> core
  58.         r3 = max number of entries to read
  59.         r4 = entry number in dir to start from
  60.         r5 = ?core
  61.  
  62. Out     as per fsfunc_ReadDirEntriesInfo, except record format is:
  63.  
  64.                 ALIGN
  65.         load    *       0               ; offsets (decimal)
  66.         exec    *       4
  67.         length  *       8
  68.         attr    *       12
  69.         type    *       16
  70.         SIN     *       20
  71.         date    *       24              ; 5 byte (cs since 1900) fs dependent
  72.         name    *       29...
  73.  
  74.  
  75.  
  76. In      r0 = fsfunc_FileInfo (10_xx)
  77.         r1 -> wildcarded object
  78.  
  79. Produce *FileInfo type list of object name(s) + info, as much as possible.
  80.  
  81. Only called if fsinfo_fileinfo is set in fsinfo word, otherwise called with
  82. fsfunc_Info.
  83.  
  84.  
  85.  
  86. Punter level changes since 1.20
  87. ===============================
  88.  
  89. OS_File
  90. -------
  91.  
  92. In      r0 = OSFile_MakeError (10_19)
  93.         r1 -> filename
  94.         r2 = object type (0,1,2)
  95.  
  96. Out     VS always: r0 -> error block, eg. "File 'xyz' not found"
  97.                                           "'xyz' is a file"
  98.                                           "'xyz' is a directory"
  99.  
  100. Typical use is to produce prettier errors, eg.
  101.  
  102.         MOV     r0, #OSFile_ReadInfo
  103.         SWI     XOS_File
  104.         BVS     flurg
  105.         TEQ     r0, #object_file
  106.         MOVNE   r2, r0
  107.         MOVNE   r0, #OSFile_MakeError
  108.         SWINE   XOS_File
  109.         BVS     flurg
  110.  
  111.  
  112. OS_GBPB
  113. -------
  114.  
  115. In      r0 = OSGBPB_ReadDirEntriesCatInfo (10_11)
  116.         r1 -> dirname
  117.         r2 -> core
  118.         r3 = max number of entries to read
  119.         r4 = entry number in dir to start from
  120.         r5 = ?core
  121.         r6 -> wildcard (0 -> use '*')
  122.  
  123. Out     as per OSGBPB_ReadDirEntriesInfo, except record format is:
  124.  
  125.                 ALIGN
  126.         load    *       0               ; offsets (decimal)
  127.         exec    *       4
  128.         length  *       8
  129.         attr    *       12
  130.         type    *       16
  131.         SIN     *       20
  132.         date    *       24              ; 5 byte (cs since 1900) fs dependent
  133.         name    *       29...
  134.  
  135. We wanted to write a generic catalogue/examine utility, where all this info
  136. is needed, but never got round to doing it ...
  137.  
  138. Unlike the corresponding low-level call, this was NOT available on 1.20.
  139.  
  140.  
  141. Enhancement to OSGBPB_ReadDir calls (9,10,11):
  142.  
  143. In      r6 -> wildcard pattern
  144.  
  145. Now r6 = 0 -> use '*' (Logistix had problem with this)
  146.  
  147.  
  148. OS_FSControl
  149. ------------
  150.  
  151. In      r0 = FSControl_Copy
  152.         r3 new bits allowed
  153.  
  154. util_peekdest   *       1 :SHL: 14 ; Quick peek at dest before loading src ?
  155. util_userbuffer *       1 :SHL: 13 ; Use punter's buffer as well as apl/rma ?
  156. util_newer      *       1 :SHL: 12 ; Copy files if newer (or binary) ?
  157. util_structureonly *    1 :SHL: 11 ; Structure only (no files) ?
  158. util_restamp    *       1 :SHL: 10 ; Restamp datestamped files ?
  159. util_noattr     *       1 :SHL: 9  ; Don't copy attributes over ?
  160.  
  161.         iff util_userbuffer then r8 -> more info, first word is user bufferaddr
  162.  
  163.  
  164. In      r0 = FSControl_FileTypeFromString (10_31)
  165.         r1 -> filetype string (CtrlChar term) of form 'Obey','&FFD','4_1230'
  166.  
  167. Out     r2 = filetype or error ('Bad number' etc.)
  168.  
  169.  
  170. In      r0 = FSControl_FileInfo (10_32)
  171.         r1 -> wildcarded object
  172.  
  173. Produce *FileInfo type list of object name(s) + info, as much as possible.
  174.  
  175.  
  176. In      r0 = FSControl_ReadFSName (10_33)
  177.         r1 = fs number
  178.         r2 -> core
  179.         r3 = ?core
  180.  
  181. Out     VC: filesystem name in core (zero terminated)
  182.         VS: r0 -> buffer overflow
  183.  
  184. Unknown fs numbers return empty string
  185.  
  186.  
  187.