home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol173 / pak.cnv < prev    next >
Encoding:
Text File  |  1984-07-15  |  1.2 KB  |  57 lines

  1.  
  2. [PAK.CNV]
  3. [Harold V. McIntosh, 18 March 1984]
  4.  
  5. [[Make composite file from many individual files.]]
  6.  
  7.  
  8.  
  9. [transcribe file]
  10. (()()(2)(
  11.   [separator at end]    ((^Z),(%W,(P),(^\MJ)));
  12.   [for debugging]    ((PWS,a: )(or),);
  13.   [write, read line]    (<2>,(%W,(P),<2>(^MJ))(R)):
  14.   )) a
  15.  
  16. [main loop - run through files]
  17. (()(
  18. ((%R,<7>:<8>.<9>)) R
  19.   )(0 8 9)(
  20.  
  21.   [avoid selfreference]    (<[9]>PAK<[20]><0>,<0>):
  22.   [avoid.BAK files]    (<[9]>BAK<[20]><0>,<0>):
  23.   [parse filename]    (<[1]>(and,<[8]>,<8>)(and,<[3]>,<9>)<[20]><0>,<<
  24.     [open file]            >>(%Or,<7>:<8>.<9>)<<
  25.     [insert its name]        >>(%W,(P),[<8>.<9>](^MJ))<<
  26.     [copy file]                >>(a,(R))<<
  27.     [close file]            >>(%C,<7>:<8>.<9>)<<
  28.     [go to next]            >><0>):
  29.   )) x
  30.  
  31. [form file list]
  32. (()()(0)(
  33.     (Not Found<0>,<0>);
  34.     (<0>,(%A,(&u,<7>:<1>))<0>):
  35.   )) y
  36.  
  37. [choose and open output file]
  38. (()(
  39.   (<7>:<6>.PAK) P
  40.   )(6)(
  41.   [no more files]    (Not Found,);
  42.   [avoid .PAK files]    (<[9]>PAK,(%A,(&u,<7>:<1>))):
  43.   [avoid .BAK files]    (<[9]>BAK,(%A,(&u,<7>:<1>))):
  44.   [parse filename]    (<[1]>(and,<[8]>,<6>)<[23]>,<<
  45.     [open .PAK file]        >>(%Ow,(%T,(P)))<<
  46.     [now process list]        >>(x,(y,(%S,(&u,<7>:<1>))))<<
  47.     [close .PAK file]        >>(%C,(%T,(P)))<<
  48.                 >>);
  49.   )) z
  50.  
  51. [main program]
  52. (()()(1 7)( (<7>:<1>,(z,(%S,(&u,<7>:<1>)))); (<1>,@:<1>): ))
  53.  
  54. [end]
  55.  
  56.  
  57.