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"count test\n"; print"\n"; print c; print"\n"; File.unlink($lock) exit 0 ------------------ここまで こんどはフォームからの入力に挑戦してみます。 ところでflock関数(?)を試してみたところ 「The flock() function is unimplemented on this machine.」 と怒られてしまいました。これはPerlの時と同じく、Windows 環境では使えないって事なのでしょうか? それとも単に使い方が悪いだけなのでしょうか? ちょっと気になったもので・・・ ----------------------------------------------------------- ホームページ随時更新中!! 遊びに来てね。 I like it!(http://www.kannet.or.jp/matusita/index.htm) Java Java Java(http://www.kannet.or.jp/matusita/jindex.htm)