Comparing an ftp directory with a local directory

  • Thread starter Thread starter deciacco
  • Start date Start date
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!
 
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
 
Back
Top