gopichaithanya has asked for the wisdom of the Perl Monks concerning the following question:
I am new to this forum. I have searched the archive for similar questions but I couldn't get quite.
I have a situation of copying a file to a remote machine. There is a trust established between the two machines and I am supposed to use 'scp' (like `scp local_file remotehost:targetdirectory/remote_file`)
If the targetdirectory does not exist.. the above command fails as, I guess, scp doesn't create directory on a remote machine if it doesn't exist.
So, what I would like to do is to do a test whether the directory exists.. if not, I would have to create one.
How do we make remote file/directory tests between two machines that have trust relationship? Is mkpath() of File::Path capable of doing that?
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File test on remote machine and mkpath
by almut (Canon) on Sep 05, 2007 at 09:56 UTC | |
|
Re: File test on remote machine and mkpath
by narainhere (Monk) on Sep 05, 2007 at 09:41 UTC | |
|
Re: File test on remote machine and mkpath
by casiano (Pilgrim) on Sep 09, 2007 at 13:15 UTC | |
by DeadPoet (Scribe) on Jan 18, 2011 at 00:16 UTC |