home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk445.lzh / MWTape / tape.doc < prev    next >
Text File  |  1991-01-24  |  2KB  |  55 lines

  1. The logic in TAPE: is awfully convoluted, but it should do basically this:
  2. On open, regardless of type, it goes into a 'just opened' state and waits.
  3. The first ACTION_READ or ACTION_WRITE throws it into the appropriate state,
  4. and from there on it only accepts further packets of that type until closed.
  5. It tries to keep track of the tape state, so that opening for write will cause
  6. an automatic append unless the tape is rewound, in which case it will over-
  7. write the tape, and that opening for read will start at the next file mark.
  8. The special file name "tape:r" forces a rewind always, and the special file
  9. name "tape:a" forces an append in write mode.  So by always using the file
  10. name "tape:r" you get the same behaviour as with the default (rewinding)
  11. Unix device driver.  Here is an example of storing two tar files on a tape,
  12. and reading them off again:
  13.  
  14.     tar cvf tape:r dir1
  15.     tar cvf tape: dir2
  16.         tar xvf tape:r
  17.         tar xvf tape:
  18.  
  19. Here is an example of storing two files, reading the first, then storing a
  20. third at the end:
  21.  
  22.     tar cvf tape:r dir1
  23.     tar cvf tape: dir2
  24.     tar xvf tape:r
  25.     tar cvf tape:a dir3
  26.  
  27. Needless to say, "tape:r" can be "TAPE:REWIND" or what have you as long as
  28. an "r" or "R" follows the colon.  Likewise for "TAPE:APPEND".
  29.  
  30. Note that in the above examples, interrupting a tape read with ^C would
  31. not have mattered, since the next open for read would skip automatically
  32. until it finds a file mark.
  33.  
  34. The only thing a "tape file system" could do that TAPE: can't is store
  35. named files on a sequential-access tape, i.e. do basically what the cassette
  36. system on a Commodore PET did.  Since skipping to file marks imposes as much
  37. wear as actually reading data and I can now read in streaming mode (I presume
  38. you have always been able to do that) there is no penalty for just using "tar"
  39. as the file system -- except that a tar archive must be created all at once.
  40.  
  41. If I found the need, I'd probably add a "TAPE:SKIP<n>" special file name, so
  42. that "tape:s5" would mean "skip 5 files then read".  But I haven't needed it
  43. yet.
  44.  
  45. -------------------------------------------------------------------------
  46.  
  47. Notes:
  48.  
  49.   The TAPE: mountlist entry will cause the Commodore mount command to choke.
  50. You must (with this version) use the ARP mount command, unless you want to
  51. modify the tape-handler to contain the necessary info, perhaps in a 'patch'
  52. area that can be modified with an external program.
  53.  
  54. -------------------------------------------------------------------------
  55.