home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1996-04-02 | 2.8 KB | 111 lines |
- V1.10
- buffer 255,names$(77)
- "XOS_ChangeDynamicArea",1,800*1024
- "OS_GSTrans","<backit%number>",buffer,256
- !number%=
- getstring(buffer))
- number%=0
- number%=3
- get todays date
- ?(buffer)=1
- "OS_Word",14,buffer
- text_1$=
- ~?(buffer+2)
- (text_1$)=1
- text_1$="0"+text_1$
- text_2$=
- ~?(buffer+1)
- (text_2$)=1
- text_2$="0"+text_2$
- text_3$=
- ~?buffer
- 0todays_date$=text_1$+"/"+text_2$+"/"+text_3$
- check to see if lastdate file exists
- "XOS_Find",&40,"<backit$dir>.last"
- result%
- "OS_Find",0,result%
- flag%=
- result% = 0
- "OS_Find",&80,"<backit$dir>.last"
- handle%
- #handle%,todays_date$
- "OS_Find",0,handle%
- ("Settype "+"<backit$dir>.last FFF")
- flag%=
- read in last date the computer was used
- "OS_Find",&40,"<backit$dir>.last"
- handle%
- #handle%,lastused$
- "OS_Find",0,handle%
- lastused$<>todays_date$
- flag%=
- backit:
- savedate:
- lastused$=todays_date$
- ("Filer_Opendir "+"<backup$dir>."+todays_date$)
- "XOS_ChangeDynamicArea",1,-800*1024
- backit
- "Hourglass_On"
- get backit file data.
- "OS_Find",&40,"<backit$dir>.objects"
- handle%
- handle% = 0
- ("ERROR 0 You must create a list of files/directories you want backed!"):
- "OS_File",8,"<backup$dir>."+todays_date$
- path1$="<backup$dir>"
- 6# path2$=path1$+"."+todays_date$
- offset%=0:numberfound%=0
- "OS_GBPB",10,path1$,buffer,1,offset%,128,0
- ,,,read%,offset%
- read% >0
- buffer!16 >0
- numberfound%+=1
- >1 names$(numberfound%)=
- getstring(buffer+20)
- offset%=-1
- sortdates
- This gets over a wee bug when using LongFilenames
- numberfound%>number%
- wipe%=0
- ("WIPE "+path1$+"."+names$(1)+" ~CFR~V")
- "OS_File",5,path1$+"."+names$(1)
- result%
- wipe%+=1
- result%=0
- wipe%>9
- wipe%>9
- ("ERROR 0 For some reason the !Back_it program can not delete one of its' backup directories."):
- this allows you to place comments in the objects file prefixed with a '|'
- from$=
- #handle%
- from$,1) <>"|"
- this stops extra CRs at the eof from confusing the program
- from$ > 3
- ("COPY "+from$+" "+path2$+".* ~CFNLQR~V")
- #handle%
- "OS_Find",0,handle%
- "Hourglass_Off"
- savedate
- "OS_Find",&80,"<backit$dir>.last"
- handle%
- #handle%,todays_date$
- "OS_Find",0,handle%
- sortdates
- z=1
- numberfound%
- x=z
- numberfound%
- names$(z),4,2)+
- names$(z),2)) >
- names$(x),4,2)+
- names$(x),2))
- names$(x),names$(z)
- getstring(ptr%)
- l p$=""
- (?ptr%>31
- ?ptr%<256)
- (p$)<255
- c%=?ptr%
- p$+=
- ptr%+=1
-