Running this returns the error “test33.rb:2: undefined method `syscopy’
for File:Class (NoMethodError)”. What am I missing?
The following code was recommended to me by Matz some time ago.
What I want to know is, what do I replace <do_stuff_here> with
to copy every file found under “some_directory” to single target directory,
without reproducing the path structure. Result would be a single flat
directory some_target. (Not controlling for possible file duplicate
overwriting for the moment.)
for f in Dir.glob("./some_directory/**/*")
File.open(f) { |file|
<do_stuff_here>
}if File.file?(f)
end
The following code was recommended to me by Matz some time ago.
What I want to know is, what do I replace <do_stuff_here> with
to copy every file found under “some_directory” to single target directory,
without reproducing the path structure. Result would be a single flat
directory some_target. (Not controlling for possible file duplicate
overwriting for the moment.)
for f in Dir.glob(“./some_directory/**/*”)
File.open(f) { |file|
<do_stuff_here>
}if File.file?(f)
end