[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Re: Calling flock with block?

From: Bertram Scharpf <lists@...>
Date: 2006-01-12 03:01:17 UTC
List: ruby-core #7114
Hi,

Am Donnerstag, 12. Jan 2006, 08:21:36 +0900 schrieb Mathieu Bouchard:
> On Thu, 12 Jan 2006, Bertram Scharpf wrote:
> >   File.open "somefile", "a" do |f|
> >     f.flock File::LOCK_EX do
> >       f.print ...
> >     end
> >   end
> 
> class File
>   def blocklock(x)
>     flock x
>     yield
>   ensure
>     flock LOCK_UN
>   end
> end
> 
> > My primary problem is how to handle exceptions that occur
> > while writing to the file.
> 
> use "ensure".

I _did_ use `rb_ensure' in my proposal. This was the tricky
part.

Concerning "-a"s thorough considerations I admit there's no
quick-to-shoot answer. Anyway, leaving LOCK_UN by itself
doesn't seem to be POLSy to me.

Bertram


> 

-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

In This Thread