RE: FW: suggestion for sftp process
- From: cshaffer@xxxxxxxxx (Curt Shaffer)
- Date: Wed, 15 Mar 2006 10:16:56 -0500
-----Original Message-----
From: Chas Owens [mailto:chas.owens@xxxxxxxxx]
Sent: Tuesday, March 14, 2006 11:48 AM
To: Curt Shaffer
Cc: beginners@xxxxxxxx
Subject: Re: FW: suggestion for sftp process
On 3/14/06, Curt Shaffer <cshaffer@xxxxxxxxx> wrote:
I have a small update to this post. I found out that I will be able to getto
all of the files in the remote directory. Unfortunately I do not see a way
to do this with Net::SFTP. There is no mget function and * does not seem
work for the file name.<snip>
Thanks
Curt
Just loop over the files in the directory.
for my $file (map { $_->{filename} } $sftp->ls('/path') {
$sftp->get("/path/$file");
}
This is what I have now:
my @files = $sftp->ls($remotedir);
foreach (@files){
$sftp->get("$_");
print "recieving $_...\n";
}
print "Complete!\n";
but what I get for each loop in debug is the following:
linuxbox: sftp: Sent message T:17 I:30
linuxbox sftp: Received stat reply T:101 I:30
Couldn't stat remote file: No such file or directory at ./sftptest line 24
recieving HASH(0x9dbb0ac)...
of course the HASH is different for each loop.
Any ideas?
.
- Follow-Ups:
- Re: FW: suggestion for sftp process
- From: Paul Lalli
- Re: FW: suggestion for sftp process
- References:
- Re: FW: suggestion for sftp process
- From: Chas Owens
- Re: FW: suggestion for sftp process
- Prev by Date: Re: Sending back an http 200 response
- Next by Date: DBI/SQL question
- Previous by thread: Re: FW: suggestion for sftp process
- Next by thread: Re: FW: suggestion for sftp process
- Index(es):