R
Rebhan, Gilbert
Hi,
running Ruby 1.8.4 under Windows 2000
i have a dir with subdirs =3D
deploy_tmp/
/subdir1
/subsubdir1
/subsubdir2
/subdir2
/subsubdir1
/subsubdir2
...
i look for the eldest dir with =3D
CANDIDATE =3D Dir["#{SRCDIR}/*"].collect { |f|=20
[test(?M, f), f]=20
}.sort.collect { |f| f[1] }[0]
and then i want to move all dirs + files beyond
the CANDIDATE folder which is all under subdir1
in the structure above, i tried with =3D
Dir.foreach({CANDIDATE) { |x|=20
FileUtils.mv x, 'Y:/bla/'<<x}
but that gave me an error =3D
c:/ruby/lib/ruby/1.8/fileutils.rb:495:in `mv': File exists - Y:/bla/.
(Errno::EEXIST)
i tried with =3D
Dir.foreach("#{CANDIDATE}") { |x| FileUtils.mv x, 'Y:/bla/'<<x, :force
=3D> true}
no error, but no move, nothing happens
What's wrong ?!
Regards, Gilbert
running Ruby 1.8.4 under Windows 2000
i have a dir with subdirs =3D
deploy_tmp/
/subdir1
/subsubdir1
/subsubdir2
/subdir2
/subsubdir1
/subsubdir2
...
i look for the eldest dir with =3D
CANDIDATE =3D Dir["#{SRCDIR}/*"].collect { |f|=20
[test(?M, f), f]=20
}.sort.collect { |f| f[1] }[0]
and then i want to move all dirs + files beyond
the CANDIDATE folder which is all under subdir1
in the structure above, i tried with =3D
Dir.foreach({CANDIDATE) { |x|=20
FileUtils.mv x, 'Y:/bla/'<<x}
but that gave me an error =3D
c:/ruby/lib/ruby/1.8/fileutils.rb:495:in `mv': File exists - Y:/bla/.
(Errno::EEXIST)
i tried with =3D
Dir.foreach("#{CANDIDATE}") { |x| FileUtils.mv x, 'Y:/bla/'<<x, :force
=3D> true}
no error, but no move, nothing happens
What's wrong ?!
Regards, Gilbert