Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to backup a folder which include sub directory,and .
Message
De
10/09/2002 07:24:08
 
 
À
10/09/2002 06:58:42
Michale Chen
Shijiazhuang ZhiYuan Crop.
Shijiazhuang, Chine
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00698680
Message ID:
00698689
Vues:
13
>Hello everyone:
> How to backup a folder which include sub directory,and the number of the sub directory didn't know?

You can either recurse the directory structure yourself, travelling to each subdirectory, backing up its files, checking to see if it has any subfolders, and if so, recursing into those subfolders, or you can use a function that has built-in recursion, such as the Scripting.FileSystemObject's CopyFolder (it copies a folder as a whole, including any subfolders) or SHFileOperation(), an API call that can perform copies with recursion. The Scripting.FileSystemObject is a part of the Windows Scripting Host, and its use in VFP is discussed in a 5 part article that George Tasker and I wrote for VFUG a while ago (www.vfug.org - there's also a link to it in the Articles area of UT), and SHFileOperation is documented in the Windows API section here on UT.

Use of a copy operation is not an adequate means of backup IMO, at least in the majority of circumstances where there is a need for ongoing, iterative backup on a regular, scheduled basis - there's a considerable amount of additional work involved in performing a backup, for which I'd recommend relying on a commercial backup product like Seagate Backup or CA ArcServe to provide all the necessary functionality.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform