[#4754] Now,I am starting ruby. — mamoru@... (Mamoru Matushita)

先日、初めて投稿したつもりだったのですが間違えて

14 messages 1997/10/02

[#4891] mixin - singleton method inheritance, const etc... — shugo@... (Shugo Maeda)

前田です。

13 messages 1997/10/10

[#5000] ruby 1.0-971015 released — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

14 messages 1997/10/15

[#5056] RubyでOODB — hisanori@...

松尾です。

20 messages 1997/10/20
[#5057] Re: RubyでOODB — matz@... (Yukihiro Matsumoto) 1997/10/20

まつもと ゆきひろです

[#5065] Re: RubyでOODB — hisanori@... 1997/10/20

松尾です。

[#5066] Re: RubyでOODB — matz@... (Yukihiro Matsumoto) 1997/10/20

まつもと ゆきひろです

[ruby-list:4794] Re: Now,I am starting ruby.

From: mamoru@... (Mamoru Matushita)
Date: 1997-10-04 14:07:10 UTC
List: ruby-list #4794
>  

みなさんどうもありがとうございました。
皆さんの講習を参考にこんな感じで組んでみました。
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
$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"<html><head><title>count test</title></head>\n";	
print"<body>\n";
print c;
print"</body></html>\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)

In This Thread