On 9-Sep-2010, Shai Ayal wrote:
| On Thu, Sep 9, 2010 at 3:15 PM, Ben Abbott <address@hidden> wrote:
| >
| > Why not always use ... fid = popen ("cat ...")?
| >
| > fid = popen (pipeline, "w")
| >
| > where `pipeline' is a string containing a piped command line. Which could be just gs. For "print test.jpg" ...
| >
| > pipeline = "cat | gs -dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r150x150 -dEPSCrop -sOutputFile=test.jpg"
| >
| > For fig ..
| >
| > pipeline = "cat | pstoedit -f fig test.fig"
| >
| > For emf ...
| >
| > pipeline = "cat | pstoedit -f fig | fig2dev -L emf test.emf"
| >
| > I'm not sure the "cat" is needed except in Shai's example, but you using this approach a pipeline of conversions can be implemented.
|
| The cat is not needed. I just used it for the example.
If you can arrange for the entire sequence of print commands to be a
pipeline, then that should take care of any race conditions related to
file creation within the print command.
It occurred to me later that there could still be problems for things like
print ("-depsc", "foo.eps");
system ("lpr -P foo.eps");