home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / s / stronghlp / Utilities / CleanCopy (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1995-02-06  |  1.7 KB  |  77 lines

  1.   >CleanCopy2
  2. $;" at ";
  3.  wrk% 255, wrk2% 255
  4. B  A$ = "ADFS::Hard1.$.StrongFS.!StrongHlp.HelpData.StrongHelp"
  5.     B  B$ = "ADFS::Hard1.$.StrongFS.!StrongHlp.HelpData.StrongHel+"
  6.  We create the new "Manual"
  7.   A% = 
  8. _DirSize(A$)
  9.  "StrongCreate "+B$+" "+
  10.  "StrongCreate "+B$+" "+
  11.  (A%+8)
  12.  Now recursively copy everything
  13. _CopyDir(A$,B$)
  14. _CopyDir(From$,To$)
  15.  offset%,read%,x%,A%,F$,T$,S%,strlen%
  16.   offset% = 0
  17. G    
  18.  "OS_GBPB",10,From$,wrk%,1,offset%,255,"*" 
  19.  ,,,read%,offset%
  20.  read% > 0 
  21.       x% = wrk%
  22.       
  23.  A% = 1 
  24.  read%
  25.  %        strlen% = 
  26. _StrLen(x%+20)
  27. !!        ?(x%+20+strlen%) = 13
  28. #'        F$ = From$ + "." + $(x%+20)
  29. $'        T$ = To$   + "." + $(x%+20)
  30.         
  31.  x%!16 
  32. &           
  33.  1 : 
  34.  "Copy ";F$
  35. '3                   
  36.  "OS_FSControl",26,F$,T$,0
  37. (&          
  38.  2 : S% = 
  39. _DirSize(F$)
  40. )(                   
  41.  "Create ";T$,S%
  42. *,                   
  43.  "Cdir "+T$+" "+
  44. +'                   
  45. _CopyDir(F$,T$)
  46.         
  47. .-        x%     += ((strlen%+4) 
  48.  3) + 20
  49.       
  50. 0        
  51.  offset% = -1
  52. _DirSize(dir$)
  53.  tot%,offset%,strlen%,A%,x%
  54.   tot% = 4
  55.   offset% = 0
  56. :I    
  57.  "OS_GBPB",10,dir$,wrk2%,255,offset%,255,"*" 
  58.  ,,,read%,offset%
  59.  read% > 0 
  60.       x% = wrk2%
  61.       
  62.  A% = 1 
  63.  read%
  64. >2        strlen% = ( 
  65. _StrLen(x%+20) + 4 ) 
  66. ?"        tot%   += strlen% + 24
  67. @"        x%     += strlen% + 24
  68.       
  69. B        
  70.  offset% = -1
  71. = tot%
  72. _StrLen(A%)
  73.   L% = A%
  74.  ?A% >= 32
  75.     A% += 1
  76. = A% - L%
  77.