[Gambas-user] Pipe doesn't receive contents

Doriano Blengino doriano.blengino at ...1909...
Fri May 7 12:14:12 CEST 2010


Rolf Schmidt ha scritto:
> Hello Rolf-Werner
>    
>> DIM hFile AS File
>> DIM sLine AS String
>>
>> hFile = PIPE "/tmp/FIFO1" FOR INPUT
>>
>> PRINT "Now let's start:"
>>
>> WHILE NOT Eof(hFile)
>>     LINE INPUT #hFile, sLine
>>     PRINT sLine
>> WEND
>>
>> PRINT "That's it."
>>
>>      
> You can't wait until EOF on a named pipe! Also a 'tail' on a named pipe will
> never give you some data - but 'cat' do!
>
> Just read and find another mechanism to stop reading.
>    
I tried cat and tail on named fifo, and both work. You can start first 
either of the two sides, and they work.
I did it with:

mkfifo /tmp/fifo
ls >/tmp/fifo

then, in another terminal:

tail -3 /tmp/fifo

I also tried to start first the tail command, and then the cat >...

Rolf-Werner: you can try to first start "ls >/tmp.FIFO" and then your 
gambas app; you can also try to open /tmp/FIFO from gambas using a 
normal syntax instead of PIPE special one. Just a try...

Regards,
Doriano





More information about the User mailing list