Sha256: 824eb2e02b3a0c1ea482d08fea4be1163abc117cec89acd93b757fe81854928c
Contents?: true
Size: 868 Bytes
Versions: 7
Compression:
Stored size: 868 Bytes
Contents
def syncrwdaddressdata require 'fileutils' @rwdaddressessyncresult = "" begin @rwdaddressessyncresult = "updating local files" + "\n" Dir.chdir($progdir) localfileListarray = Dir.new($addressfiles_directory).entries.sort.delete_if { |tmpfile| ! (tmpfile =~ /nam$/) } remotefileListarray = Dir.new($rwdaddresses_updatedirectory ).entries.sort.delete_if { |tmpfile| ! (tmpfile =~ /nam$/) } tempupdatefilelistarray = remotefileListarray - localfileListarray if tempupdatefilelistarray tempupdatefilelistarray.each do |temp| tmpfilenametosync = File.join($rwdaddresses_updatedirectory,temp) tmpfilenamecopied = File.join($addressfiles_directory,temp) FileUtils.cp( tmpfilenametosync, tmpfilenamecopied) @rwdaddressessyncresult = @rwdaddressessyncresult + temp + "\n" end end rescue print "sync error" end end
Version data entries
7 entries across 7 versions & 2 rubygems