From: mamoru@... (Mamoru Matushita) Date: 1997-10-04T23:07:10+09:00 Subject: [ruby-list:4794] Re: Now,I am starting ruby. > みなさんどうもありがとうございました。 皆さんの講習を参考にこんな感じで組んでみました。 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ $data="./test.dat"; $lock="./lock/lock"; #new begin check_file=open($data,"r") rescue new_file=open($data,"w") new_file.print "0\n" new_file.close end #lock try=0 begin File.symlink(".",$lock) rescue try+=1 if try>5 then print"error\n" File.unlink($lock) exit 0 else sleep(2) retry end end count=open($data,"r") c=count.gets.to_i c+=1 count.close count=open($data,"w") count.print c count.close count=open($data,"r") c=count.gets count.close #html print"Content-type:text/html\n\n"; print"