[comp.sys.amiga] Using PIPE: device

healy@nrl-cmf.UUCP (Liam Healy) (01/30/89)

I am having trouble using the PIPE: device.
I am writing a file in DME, and I want to feed the finished
file into Proff.  So, I saveas PIPE:a, go to a CLI, and then
run proff PIPE:a foo.fmt.  No output, DME locks up.  So I do it
the other way around, i.e., run proff first then save from DME.
A little better this time ... I get a file foo.fmt, but it is
empty.  Am I doing something stupid?  By the way, I can use the
PIPE: device without problems with e.g.
  run copy file PIPE:a
  proff PIPE:a foo.fmt
but that defeats the idea of a pipe.
Thanks for the help.

Liam Healy, Naval Research Laboratory, Washington, DC  20375 USA
healy@cmsun.nrl.navy.mil     (202) 767-2851

gay%elde.epfl.ch@cunyvm.cuny.edu (David Gay) (01/31/89)

Liam Healy <healy@nrl-cmf.uucp> writes:
>I am having trouble using the PIPE: device.
>I am writing a file in DME, and I want to feed the finished
>file into Proff.  So, I saveas PIPE:a, go to a CLI, and then
>run proff PIPE:a foo.fmt.  No output, DME locks up.  So I do it
>the other way around, i.e., run proff first then save from DME.
>A little better this time ... I get a file foo.fmt, but it is
>empty.

I've had problems saving to pipe: with programs compiled with Manx C (it
was VT100). When I recompiled with Lattice, they went away ...

>Thanks for the help.

David Gay
GAY@ELDE.EPFL.CH, or GAY%ELDE.EPFL.CH@CLSEPF51.bitnet

cg@myrias.UUCP (Chris Gray) (01/31/89)

In article <167@nrl-cmf.UUCP> healy@nrl-cmf.UUCP (Liam Healy) writes:
>I am having trouble using the PIPE: device.
>I am writing a file in DME, and I want to feed the finished
>file into Proff.  So, I saveas PIPE:a, go to a CLI, and then
>run proff PIPE:a foo.fmt.  No output, DME locks up.  So I do it
>the other way around, i.e., run proff first then save from DME.
>A little better this time ... I get a file foo.fmt, but it is
>empty.  Am I doing something stupid?  By the way, I can use the
>PIPE: device without problems with e.g.
>  run copy file PIPE:a
>  proff PIPE:a foo.fmt
>but that defeats the idea of a pipe.
>Thanks for the help.

Well, it just so happens that I spent a couple hours over the weekend in
messing with PIPE: w.r.t. my Draco library (should go out tomorrow??).
The PIPE: device is sort of picky about what mode is used to Open it.

    MODE_NEWFILE - should be used by the write end.
    MODE_OLDFILE - should be used by the read end.

Other modes will SEEM to work (in fact, either end can read or write), but
the end-of-file signal when the writer closes the PIPE: will only get to the
reader if the above modes were used.

Thus, I suspect that DME is using (at a guess), MODE_READWRITE, which can
indeed cause one end or the other to hang. Thus, there is probably not much
that you, a user, can do about it. The only fix is to change DME. This would
have to be kludgey, since you want different modes for PIPE: than you would
normally use for files (MODE_NEWFILE for a file empties the file). I ended
up putting some specific tests for "pipe:" in my Draco I/O library. (Ugh!)

-- 
Chris Gray		Myrias Research, Edmonton	+1 403 428 1616
	{uunet!mnetor,ubc-vision,watmath,vax135}!alberta!myrias!cg

dougp@sbphy.ucsb.edu (01/31/89)

In article <167@nrl-cmf.UUCP>, healy@nrl-cmf.UUCP (Liam Healy) writes...

>I am having trouble using the PIPE: device.

This may or may not have anything to do with the trouble you are having.
I have found that the pipe names are case sensitive, and that the case 
sensitivity extends to the "pipe:" part of the name as well.  As an
example:

Pipe:a

is not the same as:

pipe:a

If one of your programs is fiddling with the case of its filenames, you 
will have to figure out what it is changeing them to (all upercase, 
all lower case, or something more perverse :-) and match it to get 
the proper pipe.

Actualy I consider this a bug in the pipe: device, I think pipes should 
be case insensitive like filenames are, it would certainly reduce the
number of hung systems caused by missmatched pipes.

---------------------------------------------------------------------
If daytime dramas are called soap opras because they mainly advertize
soap, should football coverage be called a beer circus?

          Douglas Peale
---------------------------------------------------------------------

martens@skiff.cis.ohio-state.edu (Jeff Martens) (02/01/89)

In article <1151@hub.ucsb.edu> dougp@sbphy.ucsb.edu writes:
>In article <167@nrl-cmf.UUCP>, healy@nrl-cmf.UUCP (Liam Healy) writes...

	[ stuff deleted ]

>I have found that the pipe names are case sensitive, and that the case 
>sensitivity extends to the "pipe:" part of the name as well.  As an

	[ more stuff deleted ]

>Actualy I consider this a bug in the pipe: device, I think pipes should 
>be case insensitive like filenames are, it would certainly reduce the
>number of hung systems caused by missmatched pipes.

	[ still more stuff deleted ]

Absolutely, I agree with you that this is a bug (whether in
implementation or in specification I don't know).  Unfortunately, I
wouldn't expect it to be fixed in later releases because the people at
Commodore have to assume that somebody's made use of this as a
"feature." 

-- Jeff

dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) (02/01/89)

	I think the lesson is that the proper way to implement a PIPE:
device is to explicitly say which side you are connecting to.  I.E.

	program1 >pipe1:a
	program2 <pipe2:a

	This way, there can be no mistaking who is who and you can also
implement a two-way stream painlessly.

					-Matt