POV-Ray : Newsgroups : povray.programming : stream output handling pb Server Time
17 May 2024 07:43:13 EDT (-0400)
  stream output handling pb (Message 1 to 2 of 2)  
From: Vincent LE PRINCE
Subject: stream output handling pb
Date: 26 Jan 2005 11:07:45
Message: <pan.2005.01.26.16.10.26.853305@nospam.wanadoo.fr>
Hi !

	I'm working on a povray frontend called Truevision, and i got a few
difficulties with streams handling of version 3.61. Any idea is welcome ! 
Here is the story :

  _ i'm working with povray 3.61 and c++ on a linux box
  _ i launch povray from my frontend using :
	_ execve to create the process
	_ option +GA to redirect stats to a first pipe ( opened with mkfifo and option
NONBLOCK )
	_ a console redirection '&> ' to a second pipe ( opened with mkfifo and no option )
	_ each pipe is handled by a thread
	_ i also use option 'Display' ( with Xwindow ) and 'Pause When Done' so that user
	can watch his pretty new image :)
  _ the first pipe ( stats ) gets povray output but ends when render is complete. Last
line
  could be, for example, 'rendering line 125 of 425...' and then povray waits for the
user to
  click on the window.
  _ the second pipe gets nothing until i click on the window and THEN gets "Click on
window to exit..."

I feel povray does not flush its streams before starting to wait for user click... Any
idea to workaround this ?
I could, off course, handle graphic output but i wouldn't have mosaic preview etc...

P.S : This does not happened with povray 3.1


Post a reply to this message

From: Nicolas Calimet
Subject: Re: stream output handling pb
Date: 26 Jan 2005 12:11:43
Message: <41f7cf4f$1@news.povray.org>
> 	I'm working on a povray frontend called Truevision

	Hi, this is the wrong group to discuss about interfacing with
povray at this level (command-line).  Your post would be better suited
in p.unix, so I followup to there.

> 	_ option +GA to redirect stats to a first pipe ( opened with mkfifo and option
NONBLOCK )

	Beware that the stream redirections do not work well in 3.6.1.

> 	_ a console redirection '&> ' to a second pipe ( opened with mkfifo and no option )

	The &> syntax will only work on csh-based shells.  For all the other
shell familly (at least sh/bash and possibly zsh, ksh as well) you should use
the 2> syntax in this case.

> I feel povray does not flush its streams before starting to wait for user click...
Any idea to workaround this ?

	The stats cannot be flushed until the very end of the rendering, as they
include wall-clock time information.  Normally stderr (that you get with &>) is
not buffered, so you should get its content without delay.  Most likely the pipe
itself induces input buffering (it makes your connected process read from stdin,
which is buffered).

	- NC


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.