[Ssh-sftp-perl-users] Exclude directories in $sftp->ls()??
Brought to you by:
dbrobins
|
From: Fredrik S. <str...@gm...> - 2008-01-29 13:58:39
|
Hello!
Iam writing a script for automated download and send of files using NET:SFTP.
Just ran into following problem:
In my sub for fetching files i do like this to figure out what files
are present in the directory on the remote server.
foreach ($sftp->ls($ddir)) {
next if ($_->{filename} =~ m/^\./);
next if (-d "$ddir\/$_->{filename}");
push(@files, $_->{filename});
}
return (@files);
I exclude . and .. but to exclude the directories i have no success. I
use the same loop with (-d) for excluding directories locally when i
send files and that works with a smile..
Best Regards
plura
|