[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pqing from other than stdout or /dev/tty? (fwd)




===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================

---------- Forwarded message ----------
Date: Mon, 09 Oct 2000 15:47:08 -0600
From: Russ Rew <address@hidden>
To: Kevin Tyle <address@hidden>
Subject: Re: pqing from other than stdout or /dev/tty? 

Kevin,

> I have been able to successfully ingest data with the LDM
> from our new Dyncorp data service.  What I have done is
> use an edited version of the ingest program that they provide,
> and then pipe the data stream, which is written to stdout,
> to pqing:
> 
>   (dyncorp_ingest | pqing -f dds - ) 2> ingest.err
> 
> But what I would really like to do is write the data to
> a separate file--not stdout--and then just handle the ingest
> from my ldmd.conf.  Similar to how I did it when
> we were reading from the serial port from the Alden
> satellite feed:
> 
>   exec    "pqing -b 9600 -f ids /dev/ttyS0 -n -p even"
> 
> But is there an analogue to the /dev/ttyS0 file that I could
> write the data to?  I.e. a file that contains the data
> as it is written out, but doesn't actually accumulate in
> size, like a regular file?  Is there some /dev file that
> accomplishes this?

I think what you want can be done with a FIFO file, a little-used but
elegant way to communicate between processes on Unix systems.

First make the FIFO file with something like:

  mkfifo /tmp/ingest.fifo

Then have the dyncorp_ingest program write to that "file" (it's not
really a file in the conventional sense, it's a named pipe):

  dyncorp_ingest > /tmp/ingest.fifo

Then you can have pqing read from this "file" when it's invoked from
ldmd.conf:

  exec    "pqing -f ids /tmp/ingest.fifo"

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu