Best practice advice

Jayson

Member
Joined
Jun 3, 2008
Messages
10
Programming Experience
1-3
Hi,

I've been tasked with developing a migration tool that will create files and folders within a DMS. The data to be migrated is in the order of hundreds of gigs (migrated over a number of phases) with potentialy up to 15 to 16 levels of folders in the file system. Essentialy I'll be re-creating the file system within the DMS.

Performance is a key criteria for my customer. With this in mind I have a couple of ideas on how to approach the reading of the file system which I would appreciate some comments on.

1. Use a recursive method to iterate down through the file system untill the lowest level of each branch is reached capturing files and folders as required. Then, recursivly work my way back up the stack to a point where I start down the next branch of the tree.

2. Store the full path to every file throughout the structure in memory and then enumerate the collection of paths, passing the required data to the methods required for the creation of data with the DMS.

Of course, with each of these methods there is an issue of memory as the recursive methods values etc would be stored in memory as would the collection of paths.

So if my logic is correct, method 1 would be a looping type of structure that would work it's way down each branch of the file system untill it reached the lowest level and then work it's way back up the stack to a point at which the process would start over. Method 2 would still need to loop through the file system getting the paths to the files and store those paths in a collection for later access.

I am realy trying to get a feel for the best approach to this type of task. I welcome any suggestions and would especialy appreciate feedback from developers who have been tasked with similar requests.
 
A lot depends on your requirements ...

Method 2 is a two pass operation which has to be slower, right?

Since you have to have to recurse in both methods, then I would say go for method 1; unless there is a requirement for partial processing due to recovery, then you might want that list of file names to record a status against.

Do you want to be able to view the progress of the application? A UI working from a memory structure might be better than a UI tailing a log file.

How about interactively selecting files and/or whole trees?
 
Back
Top