PeƱa, Botp wrote:
> From: list-bounce / example.com
> # > # here i combine those 3 arrays into 1 multi-dim array
> # > sd_a=source.zip(dest,options)
> #
> # hmmm, would combining the arrays be feasible if i were to add on more
> # values to the either of the arrays?
> 
> i zipped it because,
> 1. i was too lazy to retype it again
> 2. i knew it would work since your arrays are one-to-one on each other
> 
> # > sd_a.each do |sd|
> # >   source, destination, selections = sd
> # >   src = File.join source,selections
> # >   puts "Source: #{src}"
> # >   puts "Dest:   #{destination}"
> # >
> # >   # i comment the 2 lines below for you to choose bw recurse or not
> # >   # again, if you recurse, check for directory overlaps
> # >
> # >   # FileUtils.cp src, destination
> # >   # FileUtils.cp_r src, destination
> #
> # This command runs an error because the value of src is
> # "C:/movtest/test/2008*" and it doesnt recognise this wildcard but
> # instead looks for the file which has the name 2008*.
> # so i tried to chang it alil:
> 
> no problem, just do
> 
>   FileUtils.cp Dir.glob(src), destination
> 
> that should work because i just tested it here :)
> 
> kind regards -botp


it works ;)
But one issue, when i changed to FileUtils.mv Dir.glob(src), destination 
because i needed to move the files, it shows a big error msg:
c:/ruby/lib/ruby/1.8/fileutils.rb:505:in `rename': Permission denied - 
C:/movtes
t/testing/20080321 or U:/test_1/20080321 (Errno::EACCES)
        from c:/ruby/lib/ruby/1.8/fileutils.rb:505:in `move'
        from c:/ruby/lib/ruby/1.8/fileutils.rb:1395:in 
`fu_each_src_dest'
        from c:/ruby/lib/ruby/1.8/fileutils.rb:1404:in 
`fu_each_src_dest0'
        from c:/ruby/lib/ruby/1.8/fileutils.rb:1402:in `each'
        from c:/ruby/lib/ruby/1.8/fileutils.rb:1402:in 
`fu_each_src_dest0'
        from c:/ruby/lib/ruby/1.8/fileutils.rb:1393:in 
`fu_each_src_dest'
        from c:/ruby/lib/ruby/1.8/fileutils.rb:494:in `move'
        from testing.rb:42
        from testing.rb:32:in `each'
        from testing.rb:32

It seems like some problem with the access rights.. Any advice?
I'm still quite new to ruby so ya, but I'm really thankful for the help 
so far though. ;)

-- 
Posted via http://www.ruby-forum.com/.