D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Running programs that require a terminal - without one.

 

jody salt wrote:
> Hi everyone,
>    
>   I've finally tried running it from my code - and it doesn't work - I believe 
> 'screen' requires a terminal as well!! Doh!!
>    
>   So anymore ideas would be welcome!
>    
>   I've tried running lame in silent mode, and redirecting the stdin and stderr to 
> /dev/null e.g.
>    
>   system("lame --silent in_file.mp3 out_file.mp3 1> /dev/null 2> /dev/null")
>    
>    and nothing works!
>    
>   There must be a standard way running commands that require a terminal without 
> one (i.e. some sort of  terminal emulator program) - I can't of been the first 
> ever person to have this problem!
>    
>   Also doesn't any one know what the mechanics are behind a terminal? - i.e. it 
> can't be just simple stdin and stdout?

Since lame works perfectly happily from something like "grip", which
needn't have a controlling tty, I don't know why it doesn't work for
you.

Are you absolutely certain that lame is failing because it doesn't
believe it's connected to a tty?  What convinces you of this?

Have you tried doing something along the lines of

  system ( "strace -o /var/tmp/lame.log lame in_file.mp3 out_file.mp3
      > /var/tmp/lame.out 2>/var/tmp/lame.err" )

and checking each of the files to see if anything useful is logged?

Do you have full PHP error reporting enabled and does it report any
errors?

James

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html