discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] gr.file_descriptor_* and close()


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] gr.file_descriptor_* and close()
Date: Fri, 8 May 2009 11:31:48 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, May 08, 2009 at 11:13:22AM +0200, Martin Braun wrote:
> Hi,
> 
> it's just a nitpick, really, but I'd like to vote for chucking out the
> close() calls in gr.file_descriptor_{sink,source} (in the destructors).
> 
> I've been working with these blocks for talking across pipes, and I
> constantly run into warnings because files get closed when I don't want
> them to. So far, it hasn't caused any errors, but the reason my code
> gets confused is because when I use a named pipe, I have to open it in
> one thread and pass the fileno to the GR block. The block, however,
> closes the file on destruction, leaving a dangling file ID in the
> calling thread.

You can avoid this problem by passing the result of
os.dup(file_descriptor) to gr_file_descriptor_*.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]