D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

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

[LUG] emulating ttys in perl



Hi there

I have trying to pipe to the lame command line program
in perl a cgi script.

using for instance
(simplest way of doing it(using backticks)):

$out = `lame -b 16 test.mp3 -`;

or

$out = system('lame -b 16 test.mp3 -;');

What should happen is that I grab the resampled mp3
(at lower bit rate of 16).

I have found that it doesn't work because the program
needs a tty.

It makes sense because programmer obviously wanted to
keep the processsing display infomation separate from
the STDOUT.

I have since found a lot of other linux command line
tools also need ttys in order to work.

So I was wondering were the ttys are defined from a
prgramming point of view i.e. is there some command
that allows you to take a process id and a tty device
an argument to set up tty's for that process.

My hunch is that I could probabley some how use the
/dev/null device.

Has any body else come across this problem?

I guess I could use a pre written module, but I would
prefer to do it my self as I would like to understand
linux at a more low level.

Cheers

Jody Salt

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly