Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Backing up to CD R or R/W
Message
 
 
To
17/06/2002 10:49:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00668796
Message ID:
00669644
Views:
15
>Hi Ron
>
>I'm looking for a procedure to automatically backup data to CD's by DirectCD,
>how do you backup your data to CD ? Do you just use DirectCD and drag and drop,or do you do it thru a program.
>
>TIA
I use a program (VFP). I create an array of the drive\folder to backup and process the array based on file date stamp and copy those files that meet my critria to that drive directly.

Here is an example from one of my programs:

&&& you can also poll drives to find your CD drive (WSH API)
drive_exists=Iif(Drivetype('e:')=5,.t.,.f.)
disklabel=Alltrim(Upper(sys_volumename("E:\"))) && focus.fll library

Do case
Case !drive_exists
=MESSAGEBOX("CD Drive Non Functional",16+0+0,"")
return
case DISKSPACE('E:\')=-1
=MESSAGEBOX("Not RW CD in Drive",16+0+0,"")
return
Case !DISKSPACE('E:\')>0
=MESSAGEBOX("No CD in Drive",16+0+0,"")
return
Case Alltrim(Upper(this.Tag))<>disklabel
=MESSAGEBOX( disklabel+" CD Not in Drive",16+0+0,"")
Return
endcase

Set Default To x:\ && mapped Network Drive
***Public Array myarray
Adir(myarray,"*.dbf")
Asort(myarray,1)
lastrec=Int(Alen(myarray)/5)

For i = 1 To lastrec
checkfile=myarray(i,1)
lastupdatedfile='E:\'+checkfile

If !File(lastupdatedfile) && file does not exist
backupfile=.t.
Else
backupfile=Iif(Fdate(checkfile)=Fdate(lastupdatedfile),.f.,.t.) && check last update file stamp
Endif

If backupfile
Copy File &checkfile To &lastupdatedfile
If Justext(checkfile)='DBF' && check for files with associated extensions
checkfile=Forceext(checkfile,'FPT')
If File(checkfile)
lastupdatedfile=Forceext(lastupdatedfile,'FPT')
Copy File &checkfile To &lastupdatedfile
Endif
checkfile=Forceext(checkfile,'CDX')
If File(checkfile)
lastupdatedfile=Forceext(lastupdatedfile,'CDX')
Copy File &checkfile To &lastupdatedfile
Endif
Endif
Endif

Endfor
Ronl
Previous
Reply
Map
View

Click here to load this message in the networking platform