home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / fileutils / back_it / !Back_it / !Runimage (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1996-04-02  |  2.8 KB  |  111 lines

  1.  V1.10
  2.  buffer 255,names$(77)
  3.  "XOS_ChangeDynamicArea",1,800*1024
  4.  "OS_GSTrans","<backit%number>",buffer,256
  5. !number%=
  6. getstring(buffer))
  7.  number%=0 
  8.  number%=3
  9.  get todays date
  10. ?(buffer)=1
  11.  "OS_Word",14,buffer
  12. text_1$=
  13. ~?(buffer+2)
  14. (text_1$)=1 
  15.  text_1$="0"+text_1$
  16. text_2$=
  17. ~?(buffer+1)
  18. (text_2$)=1 
  19.  text_2$="0"+text_2$
  20. text_3$=
  21. ~?buffer
  22. 0todays_date$=text_1$+"/"+text_2$+"/"+text_3$
  23.  check to see if lastdate file exists
  24.  "XOS_Find",&40,"<backit$dir>.last" 
  25.  result%
  26.  "OS_Find",0,result%
  27. flag%=
  28.  result% = 0 
  29.  "OS_Find",&80,"<backit$dir>.last" 
  30.  handle%
  31. #handle%,todays_date$
  32.  "OS_Find",0,handle%
  33. ("Settype "+"<backit$dir>.last FFF")
  34.  flag%=
  35.  read in last date the computer was used
  36.  "OS_Find",&40,"<backit$dir>.last" 
  37.  handle%
  38. #handle%,lastused$
  39.  "OS_Find",0,handle%
  40.  lastused$<>todays_date$ 
  41.  flag%=
  42. backit:
  43. savedate:
  44.  lastused$=todays_date$ 
  45. ("Filer_Opendir "+"<backup$dir>."+todays_date$)
  46.  "XOS_ChangeDynamicArea",1,-800*1024
  47. backit
  48. "Hourglass_On"
  49.  get backit file data.
  50.  "OS_Find",&40,"<backit$dir>.objects" 
  51.  handle%
  52.  handle% = 0 
  53. ("ERROR 0 You must create a list of files/directories you want backed!"):
  54.  "OS_File",8,"<backup$dir>."+todays_date$
  55.  path1$="<backup$dir>"
  56. 6# path2$=path1$+"."+todays_date$
  57. offset%=0:numberfound%=0
  58.  "OS_GBPB",10,path1$,buffer,1,offset%,128,0 
  59.  ,,,read%,offset%
  60.  read% >0 
  61.  buffer!16 >0 
  62.    numberfound%+=1
  63. >1   names$(numberfound%)=
  64. getstring(buffer+20)
  65.  offset%=-1
  66. sortdates
  67.  This gets over a wee bug when using LongFilenames
  68.  numberfound%>number% 
  69.  wipe%=0
  70. ("WIPE "+path1$+"."+names$(1)+" ~CFR~V")
  71.  "OS_File",5,path1$+"."+names$(1) 
  72.  result%
  73.   wipe%+=1
  74.  result%=0 
  75.  wipe%>9
  76.  wipe%>9 
  77. ("ERROR 0 For some reason the !Back_it program can not delete one of its' backup directories."):
  78.  this allows you to place comments in the objects file prefixed with a '|'
  79.    from$=
  80. #handle%
  81. from$,1) <>"|"
  82.  this stops extra CRs at the eof from confusing the program
  83.  from$ > 3 
  84. ("COPY "+from$+" "+path2$+".* ~CFNLQR~V")
  85. #handle%
  86.  "OS_Find",0,handle%
  87. "Hourglass_Off"
  88. savedate
  89.  "OS_Find",&80,"<backit$dir>.last" 
  90.  handle%
  91. #handle%,todays_date$
  92.  "OS_Find",0,handle%
  93. sortdates
  94.  z=1 
  95.  numberfound%
  96.  x=z 
  97.  numberfound%
  98. names$(z),4,2)+
  99. names$(z),2)) > 
  100. names$(x),4,2)+
  101. names$(x),2)) 
  102.  names$(x),names$(z)
  103. getstring(ptr%)
  104. l    p$=""
  105.  (?ptr%>31 
  106.  ?ptr%<256) 
  107. (p$)<255
  108.   c%=?ptr%
  109.   p$+=
  110.   ptr%+=1
  111.