die with grace

This commit is contained in:
Ward Wouts 2003-04-24 12:14:36 +00:00
parent 081b2a02e2
commit 97a8b5ea28
2 changed files with 7 additions and 2 deletions

View file

@ -1,8 +1,9 @@
# $Dwarf: CHANGELOG,v 1.18 2003/04/24 07:48:48 ward Exp $
# $Dwarf: CHANGELOG,v 1.19 2003/04/24 09:44:25 ward Exp $
# $Source$
from 0.2.0 to 0.2.1
- fail gracefully at a lack of configuration
- fail gracefully if tempdir doesn't exist or isn't writable
from 0.1.0 to 0.2.0
- fix extension enforcing

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.50 2003/04/22 21:30:06 ward Exp $
# $Dwarf: ripnews.rb,v 1.51 2003/04/24 09:41:17 ward Exp $
# $Source$
require 'date'
@ -357,6 +357,10 @@ def check_ext(group, filename, mode)
end
def get_max_file_length(tempdir=".")
if ! FileTest.directory?("#{tempdir}") || ! FileTest.writable?("#{tempdir}")
print "Tempdir '#{tempdir}' is not a writable directory\n"
exit
end
name = "a"*500
begin
file = File.new("#{tempdir}/#{name}", "w", "0644").close