Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ListDirectoryDetails
Message
De
19/04/2010 01:47:52
 
 
À
19/04/2010 00:25:16
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01460672
Message ID:
01460855
Vues:
24
>Ok, so basically, this is good to get the valid timestamp from files from the server. But, when I do this synchronization process, I read about 20000 files. So, I wouldn't read the file timestamp on each of them. So, for now, my synchronization module is good for simply getting new files posted on the server. But, it wouldn't see an updated version of a specific file.


Been digging in old foxpro code ( remember your article about ftp ?)

A client of mine has a website. All the invoices have a code. With that code the customer can look at the details of the invoice. The detail of the invoice is kept for about a year.

To do that I have a local mirror (which can be any level deep). Each morning I will add the new invoices to the mirror and delete the ones that are more than a year old

I then sync a remote folder with the local folder

Sync is done in a couple of steps
(1) create blank cursor
FileName M ( = relative file path to the local mirror / remote mirror)

Local L, true if it exists locally
IsFolder_Local
Size_local I
Time_local T

Remote L (true if it exists remotely)
IsFolder_Remote
Size_remote
Time_remote

(2) Fill the cursor with the local files (to any depth)
- FileName
- Local true
- size_local
- time_local

(3) Fill the cursor with the remote files
Remote L (true)
Size_remote
Time_remote

If the file alreay exists in the cursor, I fill out the fields
otherwise, I append a record and fill out FileName + fields


(4) Remove obsolete remote files
- cursor is sorted in length of the filename DESCENDING ( so I process files before the conatining folder)

for each record where ( !Local and Remote) or (IsFolder_Loal < > isFolder_Remote)
delete remove file (or folder)

(5) Sync local >> remote
- cursor is sorted in length of the filename ASCENDING ( so i process folders before the files in them)

for each record where ( local and (!remote or Time_local > Time_remote )
make folder or tyransfer file
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform