C
Clement Ow
All,
First of all,
Thanks to those who helped out in my previous thread. It was really of
great help.
Alright now, another issue i just can figure out, so i
decided to post a new thread
source=%w[C:/movtest/testing
C:/movtest/testing/new
U:/movtest/source
U:/movtest/new
U:/movtest/new1]
dest=%w[U:/test_1/
U:/dest1/
U:/dest2/
U:/dest3/
U:/dest4/]
selections=["2008*", "2008*", "2008*", "asd*", "asd*"]
# here i combine those 3 arrays into 1 multi-dim array
sd_a=source.zip(dest,selections)
#puts sd_a
sd_a.each do |sd|
source, destination, selections = sd
src = File.join source,selections
puts "Source: #{src}"
puts "Dest: #{destination}"
FileUtils.cp_r Dir.glob(src), destination
puts "File Copy Test:Success"
end
I have a folder in C:\movtest\testing\ and i want to leave the last day
of the mth untouched(which means i dont wanna copy them over to the dest
path.) For example, I wanna copy any file or folder starting with 2008
but I want to keep 20080331 which is the last day of the previous mth
untouched. Is there any way i can put an exception to the command,
'FileUtils.cp_r Dir.glob(src), destination' ?
First of all,
Thanks to those who helped out in my previous thread. It was really of
great help.
decided to post a new thread
source=%w[C:/movtest/testing
C:/movtest/testing/new
U:/movtest/source
U:/movtest/new
U:/movtest/new1]
dest=%w[U:/test_1/
U:/dest1/
U:/dest2/
U:/dest3/
U:/dest4/]
selections=["2008*", "2008*", "2008*", "asd*", "asd*"]
# here i combine those 3 arrays into 1 multi-dim array
sd_a=source.zip(dest,selections)
#puts sd_a
sd_a.each do |sd|
source, destination, selections = sd
src = File.join source,selections
puts "Source: #{src}"
puts "Dest: #{destination}"
FileUtils.cp_r Dir.glob(src), destination
puts "File Copy Test:Success"
end
I have a folder in C:\movtest\testing\ and i want to leave the last day
of the mth untouched(which means i dont wanna copy them over to the dest
path.) For example, I wanna copy any file or folder starting with 2008
but I want to keep 20080331 which is the last day of the previous mth
untouched. Is there any way i can put an exception to the command,
'FileUtils.cp_r Dir.glob(src), destination' ?