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: Michael D Godfrey
Subject: Re: wait_for_file ?? [GL2PS error: Bad file pointer]
Date: Sat, 11 Sep 2010 16:42:15 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Thunderbird/3.1.3

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.

Michael


reply via email to

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