[Gambas-user] Read in EXEC.....

Rob sourceforge-raindog2 at ...94...
Fri Oct 29 16:11:10 CEST 2004


On Friday 29 October 2004 07:23, ron wrote:
> On Friday 29 October 2004 11:47, LB Audio wrote:
> > How to read the time of the file used in the command
> > EXEC [MPG321 ", SONG.MP3 "] FOR READ WRITE AS
> > $HPROCESS??????
> Only if MPG321 sends to console the time you can read it from
> $hProcess and as far I know it does not.

It does if you use -v.  I couldn't get it to work with exec 
though.  Also, mpg321 writes its time information to stderr, not 
stdout.

SHELL "mpg321 -v \"song.mp3\" 2>&1" FOR READ WRITE AS $hprocess

...

PUBLIC SUB Process_Read()

	dim l as string
	dim t as string

	if LAST.Id = $hprocess.Id then
		LINE INPUT #$hprocess, l
		if instr(l, "Time: ") then
			t = mid(l, instr(l, "Time: ") + 6, 8)
			' do something with t now...
		endif
	endif

END






More information about the User mailing list