File.open "filename" do |f|
f.flock LOCK_EX
...
end
On Wed, 12 Jan 2005 00:11:19 +0900, Sea&Gull <v / vsu.ru> wrote:
> Hi!
>
> Could you please give me a hint how in Ruby
> to open a file with exclusive lock?
>
> As I know, in perl it is something like this:
>
> open F, "filename";
> flock F, 2
>
> Thanks a lot!
>
> --
> s&g
>
>
--
$stdout.sync = true
"Just another Ruby hacker.".each_byte do |b|
('a'..'z').step do|c|print c+"\b";sleep 0.007 end;print b.chr
end; print "\n"