Re: sftp (protocol version 3) problem with a FIFO

From: Darren Tucker (dtucker_at_dodgy.net.au)
Date: 12/10/03


Date: Wed, 10 Dec 2003 21:03:57 GMT

In article <Pine.GSO.4.53.0312101219290.13781@uranos.cto.us.edu.pl>,
Jacek M. Holeczek <holeczek@us.edu.pl> wrote:
>Hi,
>I have two sets of machines running RedHat Linux 7.3/i686 (Valhalla).
>Machines 1. : kernel-2.4.18, glibc-2.2.5, openssh-clients-3.4p1
>Machines 2. : kernel-2.4.20, glibc-2.2.5, openssh-clients-3.6.1p2
>
>The problem is that I need to transfer a file from a FIFO using "sftp".
>So, in one session (on a local machine) :
> mkfifo /tmp/myfifo
> cat /etc/issue > /tmp/myfifo
>and in another session (on the same machine) :
> sftp RemoteUser@RemoteMachine
> (...)
> sftp> put /tmp/myfifo x.x
>
>This works as long as I try to transfer FIFO data from a machine belonging
>to the set 1., but if I try to transfer FIFO data from a machine which
>belongs to set 2. I get :
> Can't upload /tmp/myfifo: not a regular file
>
>Can I somehow fix it (any additional "sftp" option ?) ?
>
>Basically, I could easily use "scp" instead of "sftp".
>But if I try to transfer FIFO data using "scp" :
> scp /tmp/myfifo RemoteUser@RemoteMachine:x.x
>on both sets of machines I get :
> /tmp/myfifo: not a regular file
>
>Again, can I somehow fix it (any additional "scp" option ?) ?

You could do something like:
ssh RemoteUser@RemoteMachine cat /tmp/myfifo > localfile

That should work on both sets of machines.

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.