correct • elegant • free

△ △

◅ sh alias

copying stderr to file? ▻

using mknod

In article <87ovp6$b7e$>,  <> wrote:
>Yes , what I am trying to do is this in a nutshell;
>Use find to put selected filename into  a pipe, so that another script
>can collect the filenames and process later.

Hmm... your use of the word "later" suggests that you may have
misunderstood how named pipes work.  Like a normal pipe, they can only
buffer a certain amount of data, so you need both a reader and a writer.

If there is no reader, the writer will block till there is.

>mknod /tmp/pipefile p
>chmod 664 /tmp/pipefile
> find apps/logs -name "*.ARP" -print >/tmp/pipefile &

That looks OK, and it works for me.

    ; mknod /tmp/pipefile p
    ; find /tmp -print > /tmp/pipefile
    <this command now blocks>

In another window, I say this.  As the `cat' finishes, so does the
`find' in the first window.

    ; cat /tmp/pipefile

>Using the above commands it eithers;

Yup, this is what I'd expect if there is no reader for the pipe.

>returns cannot create

You can only create the pipe once.

    ; mknod /tmp/pipefile p
    ; mknod /tmp/pipefile p
    mknod: /tmp/pipefile: File exists

Hope this helps!

Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: (Tim Goodwin)
Subject: Re: using mknod
Date: 8 Feb 2000 16:09:15 -0000
Message-ID: <87pf41$o91$>
References: <87mh79$gn8$>
  <87mr1m$jeo$> <87ovp6$b7e$>

△ △

◅ sh alias

copying stderr to file? ▻