Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Feature Request: Upload changed files. #59

Open
128keaton opened this issue May 4, 2016 · 6 comments
Open

Feature Request: Upload changed files. #59

128keaton opened this issue May 4, 2016 · 6 comments

Comments

@128keaton
Copy link

128keaton commented May 4, 2016

I was thinking about this earlier, and I think I have a solution. Ruby isn't my language, but I could try (in a bit) to execute. Anyway, I was thinking, first upload with glynn, a file would be created containing a modified date (or an MD5) for each file. This file would also be on the server. When glynn would run, it would check if any MD5s changed, and upload those corresponding files. Just thinking logically, and programmatically, it would go something like this:

glynn upload command
-> check MD5 file (for loop through files I guess)
--> has file changed?
--->Yes? Upload file, exit for loop
---> No? Exit for loop.
--> end for loop

@dmathieu
Copy link
Owner

dmathieu commented May 4, 2016

This is definitely the right way of doing this.

@128keaton
Copy link
Author

@dmathieu wow! quick response! I'd love to try, but Ruby, as I said, is not something I have good understanding of.

@dmathieu
Copy link
Owner

dmathieu commented May 4, 2016

Unfortunately, I haven't used glynn in years, and don't have any FTP server available at hand to test this.
I might be able to implement this in the coming days/weeks, but will need someone to make sure it does properly work.

@128keaton
Copy link
Author

@dmathieu I'd happily help. I started something (from some internet examples)

Dir.foreach(ftp_dir) do |item|
  next if item == '.' or item == '..'
  File.write('md5', Digest::MD5.hexdigest File.read item)
end

@128keaton
Copy link
Author

Ok, I've been messing around a bit, and I've got this far:
https://github.com/128keaton/glynn/blob/master/lib/glynn/ftp.rb#L80

I am, however, having issues. I can read the digest of the MD5s of things inside of folders, but they don't want to write for some reason..

@128keaton
Copy link
Author

I was unable to make progress, any word from anyone else?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants