where's data on pipe's stdout?

From: Alexey Chetroi (lexa98_at_mail.md)
Date: 07/27/04


Date: 27 Jul 2004 07:49:07 -0700

Hi,

 I'm trying to make a pipe, however I cannot read data on it's out.
For short, I have a list of files and want to check each file with
"file" utility, however this script produce no results:

#!/usr/bin/tclsh

set aid [open "|file --brief --files-from -" r+]
fconfigure $aid -buffering line
fileevent $aid readable {puts [gets $aid]}
puts $aid "/win/d/movies/mp3/en/Giganten CD1/track01.cdda.ogg"
vwait forever

Where am I wrong? If I run "file --brief --files-from -" from shell,
then it show file type of each filename I enter.

I'm running tcl 8.4 on Debian Sarge box.
 
 Thanks in advance!



Relevant Pages

  • Re: Newbie question
    ... there's no pipe -- a pipe is a connection between two processes. ... The shell opens foo.txt and connects it to the process's standard input. ... most Unix programs that accept filename arguments will ...
    (comp.unix.programmer)
  • Re: find a file and output filename without dir spec and ext
    ... >> the .c extension from every filename. ... >> or a pipe or. ...
    (comp.unix.shell)
  • Re: piping to mv
    ... I am new to the group and have a question using a pipe to input ... ls -l produces a long listing, you need to extract the filename to use ...
    (comp.unix.shell)
  • Re: Another IO.popen question ...
    ... thanks for the speedy reply! ... I need to pass on a file object to 'convert' and not just a path. ... But the one-way pipe would only be useful if the OP could put a filename ...
    (comp.lang.ruby)