How to Move a Directory on a Remote Computer

  • Thread starter Thread starter ESmith
  • Start date Start date
E

ESmith

I have a progarm that needs to login to a remote system, download multiple
directories to the local system, verify that the transfer succeeded, and
then move the directories on the remote system to a "processed" directory.

What is the best way to accomplish this? Also, how would I handle the case
where the current remote directory (with all it's sub-directories and files)
already exists in the "Processed" folder - I'd like it to just overwrite/add
tothe "Processed" directory.
 
ESmith said:
I have a progarm that needs to login to a remote system, download multiple
directories to the local system, verify that the transfer succeeded, and
then move the directories on the remote system to a "processed" directory.

The main question about this problem is what protocols are you using to
access the remote system. Your description leaves that wide open. One
could imagine anything, from mapping a network share, to HTTP.

In general, moving a file without explicit delete/recreate is accomplished
by renaming it to have a different path.
Also, how would I handle the case where the current remote directory (with
all it's sub-directories and files) already exists in the "Processed"
folder - I'd like it to just overwrite/add to the "Processed" directory.

You'd have to iterate through the source and destination directories,
compare the files, and move only those that have a different size or last
modification time.
 
Back
Top