it's all in the details

This commit is contained in:
Ward Wouts 2009-02-06 08:50:41 +00:00
parent 84776cb511
commit 3088d578f5

View file

@ -39,6 +39,7 @@ ENDTXT
end
def readconfig
if FileTest.exists?("#{@basedir}/#{CONFIG}")
File.open("#{@basedir}/#{CONFIG}").each_line {|line|
line.sub!(/#.*/, "")
line.sub!(/^\s*/, "")
@ -53,6 +54,7 @@ def readconfig
else puts "unknown option #{$1}"
end
}
end
end
def status
@ -111,7 +113,7 @@ def addjob
puts "Job #{jobnumber} already scheduled. This should not happen."
exit
end
File.open("#{@basedir}/#{JOBSDIR}/#{jobnumber}"){|file|
File.open("#{@basedir}/#{JOBSDIR}/#{jobnumber}", "w"){|file|
file.puts ARGV.join(" ")
}
File.chmod(RUNMODE, "#{@basedir}/#{JOBSDIR}/#{jobnumber}")
@ -136,7 +138,7 @@ end
def createconfig
if ! FileTest.exists?("#{@basedir}/#{CONFIG}")
File.new("#{@basedir}/#{CONFIG}", "w"){|file|
File.open("#{@basedir}/#{CONFIG}", "w"){|file|
file.puts <<EOT
# how many parallel processes?
maxproc=3
@ -149,7 +151,7 @@ end
def master
# als ik threading ga gebruiken is deze dus niet nodig
File.new(RUNNINGFILE, "w").flock(File::LOCK_EX){|file|
File.open(RUNNINGFILE, "w").flock(File::LOCK_EX){|file|
file.puts "0"
}