CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
net::SFTP change directory

 



perl_issue
New User

Jun 29, 2011, 7:46 AM

Post #1 of 5 (1914 views)
net::SFTP change directory Can't Post

Hello All,

Am changing the ftp scripts which are using the net::FTP. Did not found the ftp->cwd($cwd) library function in the net::SFTP. Please help me in this.



Want to put the file in the remote directory.



Thanks,

Svasu


rovf
Veteran

Jun 29, 2011, 7:55 AM

Post #2 of 5 (1913 views)
Re: [perl_issue] net::SFTP change directory [In reply to] Can't Post

AFIK, SFTP is based on SSH, and the SSH protocol does not support chdir, and hence it is not available in Net::SFTP either.


perl_issue
New User

Jun 29, 2011, 8:10 AM

Post #3 of 5 (1912 views)
Re: [rovf] net::SFTP change directory [In reply to] Can't Post

Is there any way that i can use sftp->do_opendir and change directory in the reomote machine.

Thanks,
Svasu.


rovf
Veteran

Jun 29, 2011, 8:18 AM

Post #4 of 5 (1911 views)
Re: [perl_issue] net::SFTP change directory [In reply to] Can't Post

I would track the "working directory" on the client side and always use the full path.

If you google for Net::SFTP and chdir, you will find several discussions about how to solve this problem.


salva
Novice

Jul 2, 2011, 10:51 AM

Post #5 of 5 (1884 views)
Re: [perl_issue] net::SFTP change directory [In reply to] Can't Post

Use Net::SFTP::Foreign (http://search.cpan.org/perldoc?Net::SFTP::Foreign) that supports changing the remote working directory (with the setcwd method).

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives