Cristian-Gyozo HABA wrote:
> 
> Hi,
> 
> I am using vtcl to build an interface to some command-line type programs. For 
>launching a program I use this kind of line:
> 
>  exec psnup $nmbpages $sourcefile $destinationfile &
> 
> (this example is launching psnup program in order to generate a PostScript file 
>($destinationfile) where on a page I will have multiple pages ($nmbpages) of the 
>original PS document ($sourcefile))
> 
> My problem is, how could I know that psnup (or anyother program) has finished his 
>job so I could have access to the file it has generated ($destinationfile) ?
> 

Hello,

Maybe you could try to do something along the following lines:

-----------------------
global PID

# exec
set PipeHandle [open "|psnup $nmbpages $sourcefile $destinationfile"]

# Set to non-blocking
fconfigure $PipeHandle -blocking 0

# Grab the PID
set PID [pid $PipeHandle]
------------------------

and then perform some form of check to see if the PID is present,
or maybe checking for EOF on PipeHandle.

The above has the advantage that you could read from PipeHandle
and show the STDIO output on a TCL widget.

Regards Sean.
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to