From 5998913c87b93a1ac66d995dc4bba7e288d9a95c Mon Sep 17 00:00:00 2001 From: Ward Wouts Date: Mon, 16 Jun 2003 10:56:11 +0000 Subject: [PATCH] fix file moveing bug --- trunk/ripnews/CHANGELOG | 3 ++- trunk/ripnews/ripnews.rb | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/trunk/ripnews/CHANGELOG b/trunk/ripnews/CHANGELOG index edf963d..45b28c6 100644 --- a/trunk/ripnews/CHANGELOG +++ b/trunk/ripnews/CHANGELOG @@ -1,4 +1,4 @@ -# $Dwarf: CHANGELOG,v 1.23 2003/05/24 12:09:18 ward Exp $ +# $Dwarf: CHANGELOG,v 1.24 2003/06/15 22:28:28 ward Exp $ # $Source$ from 0.2.1 to 0.2.2 @@ -8,6 +8,7 @@ from 0.2.1 to 0.2.2 - catch another error - fetch subjects sorted so you get a better chance at getting full series + - now your TEMPDIR can be on another drive than your DATADIR from 0.2.0 to 0.2.1 - fail gracefully at a lack of configuration diff --git a/trunk/ripnews/ripnews.rb b/trunk/ripnews/ripnews.rb index 92c631d..9634c77 100755 --- a/trunk/ripnews/ripnews.rb +++ b/trunk/ripnews/ripnews.rb @@ -1,9 +1,10 @@ #!/usr/local/bin/ruby -w -# $Dwarf: ripnews.rb,v 1.63 2003/05/27 19:12:46 ward Exp $ +# $Dwarf: ripnews.rb,v 1.64 2003/06/15 22:01:43 ward Exp $ # $Source$ require 'date' +require 'ftools' require 'time' require 'getoptlong' require 'news/article' @@ -36,7 +37,7 @@ def save_file(dir, name, data) case data.type.to_s when "String" begin - if File.rename(data, "#{dir}/#{newname}") + if File.move(data, "#{dir}/#{newname}") print " Saving as: '#{newname}'\n" else print "couldn't rename tempfile\n" @@ -58,7 +59,7 @@ def save_file(dir, name, data) end when "Tempfile" begin - if File.rename(data.path, "#{dir}/#{newname}") + if File.move(data.path, "#{dir}/#{newname}") print " Saving as: '#{newname}'\n" else print "couldn't rename tempfile\n" @@ -340,7 +341,7 @@ def get_multi(subj, group) end body = fileout.path bodybase = body.sub(/\/[^\/]*$/, "") - File.rename(body, "#{bodybase}/ripnewsdecode") + File.move(body, "#{bodybase}/ripnewsdecode") body = "#{bodybase}/ripnewsdecode" file.close fileout.close(false)