I've compiled Magick (IM7) for Windows 8 with standard options and no compile errors.
I'm trying to build a simple wrapper around magick.exe with Python subprocess.POpen and have been running into trouble with buffering of the script output, which I've isolated as being an issue with how magick.exe runs on windows.
Here's the python side of things:
http://stackoverflow.com/questions/2596 ... terminates
Essentially, when magick.exe output is being redirected it is buffering the output. Is there a flag I can set to flush stdout after magick writes to stdout? To use "-script -" effectively I need to be getting the stdout buffer back in a timely manner and can't wait for the buffer to fill.
Or if you have any other ideas I'm open to them.
Regards,
Chris
stdout buffering with -script - mode
-
- Posts: 5
- Joined: 2014-09-22T02:48:01-07:00
- Authentication code: 6789
-
- Posts: 5
- Joined: 2014-09-22T02:48:01-07:00
- Authentication code: 6789
Re: stdout buffering with -script - mode
Ok. For now I've disabled the buffer with:
setbuf(stdout, NULL);
Compiling now and will test it out.
Ideally a command should always flush() when it's done, since there would be some performance gains to letting the buffer exist if the output is large.
Otherwise it'd be be nice to be able to flush manually in -script mode, so one could send:
-print %[*] -print [EOC] -flush
(where [EOC] is an end of command delimiter used by receiving program to identify when a command has finished returning)
And you'd be guaranteed to have an empty buffer after the flush command.
setbuf(stdout, NULL);
Compiling now and will test it out.
Ideally a command should always flush() when it's done, since there would be some performance gains to letting the buffer exist if the output is large.
Otherwise it'd be be nice to be able to flush manually in -script mode, so one could send:
-print %[*] -print [EOC] -flush
(where [EOC] is an end of command delimiter used by receiving program to identify when a command has finished returning)
And you'd be guaranteed to have an empty buffer after the flush command.
Re: stdout buffering with -script - mode
We'll add a patch to IMv6 / IMv7 to flush standard out after a command completes. Thanks for the suggestion.
-
- Posts: 5
- Joined: 2014-09-22T02:48:01-07:00
- Authentication code: 6789