Unless I am mistaken I don’t think sftp will preserve the file
metadata. I don’t know how ssh would either. sftp and ftp use
File.open( local_path, “wb” ) { |f| f.write contents }
After looking through the FileUtils source which can preserve metadata,
I see it just uses File.utime to set the metadata, so that is what I
will try.
Unless I am mistaken I don’t think sftp will preserve the file
metadata. I don’t know how ssh would either. sftp and ftp use
File.open( local_path, “wb” ) { |f| f.write contents }
Not the sftp I’m thinking of. In any case, you can use ssh to force a
reset
of the destination file state using data passed from the source. I think
this is how “rsync” does it.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.