in reply to Re: Perl - Socket and Data Compression
in thread Perl - Socket and Data Compression

There are a number of possibilities:

You could use Expect to fake a password interaction with SSH. That's probably your best bet because it does everything you want.

You could read the stdin and then send it to a socket, so your script has a similer user interface to ssh. E.G

$ tar -czgf- /path/to/stuff | ./your_script

You could use named pipes (AKA fifo).

$ mkfifo mypipe $ tar -czf mypipe /path/to/stuff & $ ./your_script --infile mypipe

The best place to read about all this and more is perlipc.

If you're going to do your own networking, and not use SSH, check out IO::Socket::SSL.

Replies are listed 'Best First'.
Re^3: Perl - Socket and Data Compression
by Marshall (Canon) on Jul 18, 2009 at 05:35 UTC
    My post was just "how to compress the bits". How to securely access the compresed bits is a different question which I didn't address.

    From my experience the .7Z format is cool. But I've found my typical users can't install this thing even though its freeware. However, I've also found that I can use this thing to make a .zip file about 10x as fast and 20% smaller than the Windows .zip program. The Windows "unzip" can read this 7zipped, .zip file.

      Woah... I missed the boat on that one...

      What about bzip2? tar -cvjf - /path/to/stuff | ...

      There's also rar, but I don't know much about it. I know there's a unix command unrar

      --Pileofrogs

        7zip will do better than tar.
        http://www.7-zip.org/

        7zip is free and works very, very well.