Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a computer with two NIC's and I need to copy a complete directory tree (including files) using only one NIC (or one IP if you prefer). I know that IO:SOCKET has the ability to specify which IP address is used for it's operations, but I don't know how to use that to duplicate a directory tree.

Any assistance would be greatly appreciated!
  • Comment on How to copy directory tree through single IP

Replies are listed 'Best First'.
Re: How to copy directory tree through single IP
by Abigail-II (Bishop) on Aug 14, 2002 at 13:08 UTC
    How did you intent to copy a directory tree using IO::Socket if the machine only had one NIC?

    IO::Socket just gives you a socket - nothing more. It doesn't speak a high level protocol, it doesn't implement a client, it doesn't implement a server. What do you plan to use? NFS? FTP? scp? HTTP? SMTP? UUCP? All of that is going to require quite some labouring if you plan to start working from IO::Socket.

    Abigail

      I'm not sure I understand your response? As stated, the machine has two NIC's, not one as you mention in your first sentence? As for the rest, that is why I am asking for advice. I don't know how to do that so I had hoped that someone could get me started.
        Yes, I know. So, I was asking IF the machine would have just one NIC, how would you solve it then?

        Because the problem isn't that your machine has one or two NICs. The awkwardness of your problem is that you want to start very low level, IO::Socket, and do a high level operation, copying directories.

        It's like asking "I have a bunch of screws, how do I make a car with two colours out of them". The problem isn't the colours, the problem is making a car from the screws.

        I wouldn't use Perl to solve this problem - it's a routing problem, so I'd use the routing tables. One that is solved, I'd copy the directories like I would copy them without this routing issue.

        Abigail

Re: How to copy directory tree through single IP
by perrin (Chancellor) on Aug 14, 2002 at 14:56 UTC
    That isn't much to go on. Is there some reason you aren't just using scp or rsync?