octave-maintainers
[Top][All Lists]
Advanced

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

Re: wait_for_file ?? [GL2PS error: Bad file pointer]


From: Shai Ayal
Subject: Re: wait_for_file ?? [GL2PS error: Bad file pointer]
Date: Sun, 12 Sep 2010 07:20:12 +0300

On Sun, Sep 12, 2010 at 2:42 AM, Michael D Godfrey
<address@hidden> wrote:
> On 09/11/2010 03:00 PM, Ben Abbott wrote:
>
> to use, pass the fid as a string to drawnow:
>> e.g. to keep current functionality, use
>> fid = fopen ("test.eps","wb");
>> drawnow ("eps" , sprintf ("%d" , fid));
>>
>> and to pipe it into another program, use popen:
>> fid = popen ("cat >  test.eps" , "w")
>> drawnow ("eps" , sprintf ("%d" , fid));
>>
>> Shai
>
> I'm seeing a repeatable error/warning when printing to a file.
>
> The code below ...
>
> Ben,
>
> I see what Shai said above, but I could not find where he does an
> fclose in drawnow().   By the way, it is always good practice to follow
> fclose(fid); with fid =0;  . fclose() does not change the fid, and in fact
> you can still do IO using that fid, but which file it points to will change
> as more fopens are done!  Another benefit of C and its IO libraries.
>
fclose is in glps-renderer::draw which IMHO is the only place it
should be since it's the only place guaranteed to be after the file
has been written to.

Shai



reply via email to

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