Jump to content
Macro Express Forums

Compare FTP files and desktop folder


punisa

Recommended Posts

Hello all !

 

I have a rather (I hope) simple task, but I'm kinda stuck.

I created a macro which logs in to my FTP account every 60 seconds. I figured how to download a file from FTP to specific desktop folder.

 

What I need to do now:

- check (compare) entire content of FTP folder "files" with a folder "files" on desktop

- if there is a new file on FTP, download it to desktop folder

- after all checking resume without action IF there is no new files OR take specific action if something downloaded

 

I'm afraid if I jump at this it will probably result in a one mile big script.

 

Which approach would be the best?

Link to comment
Share on other sites

Hey guys, I got it.

 

For all the future viewers, my solution:

 

- get the FTP folder contents in a T1 variable

- Variable -- modify string -- option2 -- save to text file (save T1 content)

- files/folders -- text file begin process

- loop the "text processing" to get individual FTP files

- end text process

 

During the loop you can check if file exists command and see if you have it in desktop folder or not.

If not, use the command GET to download needed file (use binary method)

 

And there you go, a handy way to transfer files across FTP to various distant computers.

 

You can have this little script looped according to a time frame (response) you need. I have it looped every 5 minutes. Cheers !

Link to comment
Share on other sites

  • 2 weeks later...

You don't need to save to file. You can simply chew thru the variable using the CRLF characters. But making a file is conceptually simpler.

 

BTW there are FTP sync/mirror programs out there already. I use WS_FTP but there are cheaper and even free ones out there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...