fix tempfile issue
remove dead code
This commit is contained in:
parent
773658d7ab
commit
1eb567322a
1 changed files with 4 additions and 24 deletions
|
|
@ -49,33 +49,13 @@ def save_file(dir, name, data)
|
|||
end
|
||||
end
|
||||
|
||||
#def tmp_file(dir)
|
||||
# name = "riptmp"
|
||||
# print "tmpname: #{name}\n" if Debuglevel > 1
|
||||
# nname = name.gsub(/\//, "-")
|
||||
# print "nname: #{nname}\n" if Debuglevel > 1
|
||||
# newname = nname
|
||||
# count = 1
|
||||
#
|
||||
# while FileTest.exists?("#{dir}/#{newname}")
|
||||
# newname = "#{nname}-#{count}"
|
||||
# count += 1
|
||||
# end
|
||||
# print "name: #{newname}\n" if Debuglevel > 1
|
||||
# fullname ="#{dir}/#{newname}"
|
||||
# if file = File.new(fullname, "w+", "0644")
|
||||
# return file, fullname
|
||||
# else
|
||||
# print "couldn't open tempfile for writeing\n"
|
||||
# end
|
||||
#end
|
||||
|
||||
def parse_options(options)
|
||||
begin
|
||||
opts = GetoptLong.new(
|
||||
[ "-I", "--include", GetoptLong::REQUIRED_ARGUMENT ],
|
||||
[ "-c", "--configfile", GetoptLong::REQUIRED_ARGUMENT ],
|
||||
[ "-L", "--longname", GetoptLong::NO_ARGUMENT ],
|
||||
[ "-M", "--multipart", GetoptLong::NO_ARGUMENT ],
|
||||
[ "-S", "--singlepart", GetoptLong::NO_ARGUMENT ],
|
||||
[ "-T", "--test", GetoptLong::NO_ARGUMENT ],
|
||||
[ "-X", "--exclude", GetoptLong::REQUIRED_ARGUMENT ],
|
||||
|
|
@ -246,7 +226,7 @@ for group in config.keys.sort
|
|||
elsif articles.group_multipart(i)
|
||||
print " Multipart!\n"
|
||||
if config[group]["TEMPDIR"] == nil or config[group]["TEMPDIR"] == ""
|
||||
body = get_group_body(i)
|
||||
body = articles.get_group_body(i)
|
||||
if articles.is_uuencoded(body)
|
||||
mode, filename, body = articles.uudecode(body)
|
||||
else
|
||||
|
|
@ -255,10 +235,10 @@ for group in config.keys.sort
|
|||
else
|
||||
body = articles.get_group_body_first(i)
|
||||
if articles.is_uuencoded(body)
|
||||
file = Tempfile.new("#{config[group]["TEMPDIR"]}/riptmp")
|
||||
file = Tempfile.new("riptmp", config[group]["TEMPDIR"])
|
||||
body.collect{|x| file.print "#{x}\n"}
|
||||
articles.get_group_body_rest(i, file)
|
||||
fileout = Tempfile.new("#{config[group]["TEMPDIR"]}/riptmp")
|
||||
fileout = Tempfile.new("riptmp", config[group]["TEMPDIR"])
|
||||
mode, filename, body = articles.uudecode(file, fileout)
|
||||
body = fileout.path
|
||||
file.close
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue