Comparing an ftp directory with a local directory

D

deciacco

I'm trying to write a utility that will compare a local directory and
it's subdirectories with a directory on an ftp server.

The .net directory and file classes could be useful on the local side,
but I don't think I can use them for the ftp side, because all I will
have is a parsed list.

At this point I'm thinking of a custom VirtualFile class that has the
file/directory information such as: filename, filedate, filetime, type
(as in file or directory), permissions, etc. To do the comparison I'm
thinking of using a hashtable of VirtualFiles. As I move down the local
hashtable I can check if the file exists in the remote hashtable.

Any comments/ideas?

Thanks!
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

deciacco said:
I'm trying to write a utility that will compare a local directory and
it's subdirectories with a directory on an ftp server.

The .net directory and file classes could be useful on the local side,
but I don't think I can use them for the ftp side, because all I will
have is a parsed list.

At this point I'm thinking of a custom VirtualFile class that has the
file/directory information such as: filename, filedate, filetime, type
(as in file or directory), permissions, etc. To do the comparison I'm
thinking of using a hashtable of VirtualFiles. As I move down the local
hashtable I can check if the file exists in the remote hashtable.

You will need to parse the FTP listing yourself. I may have some
code if you are interested.

You need to list and compare - if the directory listings are not
sorted, the Hashtable or Dictionary<string,FtpFileInfo> sounds as
a good solution.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top