Those were my conclusions also. Latest version of the SSH Transfer Protocol 
draft is 13 but still much the same. Yes, SFTP does create an SSH connection. 
It appears SSH and therefore SFTP accept only relative and full pathing. There 
is a SSH->cmd method that executes a remote command such as ls or cd but I am 
unable to get it to work (freezes - may be a Win32 thing). There is a lot of 
WWW info avail about this failure and some have apparently had success but not 
on my test boxes.

I have confirmed the PSFTP get demonstrates the same issues at the server end. 
PSFTP also issues a full path get. I've looked at four different clients and 
all appear to maintain a local virtual remote server. My code seems okay since 
it works well with the SFTP service on the server end. Unfortunately, there is 
little chance of having the server app fixed since management sees this as a 
client issue.

Anyway, thanks for the help...much appreciated.
Sturdy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Raven
Sent: Monday, May 19, 2008 5:21 AM
To: perl-win32-users
Subject: RE: How to change dir using SFTP or SSH

Sturdevant, Robert W Mr CTR USA AMC <> wrote:
> Oooops, forgot to cc the list
> Sturdy
> 
> -----Original Message-----
> 
> Hi Brian,
> 
> Thanks for the reply. Yes, path and file exist, case is correct, user 
> is logged on, etc.
> 
> This is an issue unique to the server app running on the remote.
> Unfortunately, I can't mod the app so need to code a workaround on the 
> client end. The server app was recoded from an FTP server which 
> recognized the CD command. At that time, the FTP clients did a CD 
> before getting a file. Experimentation disclosed the SFTP GET provides 
> correct results when done from the same dir as the resident file. So I 
> need to do something similar in Net::SFTP. The real problem seems to 
> be a coding error on the server side but
> unfortunately I must live with it...aargh.        

I don't know how sftp does it, but a quick browse of the SSH File Transfer 
Protocol
(http://www.openssh.com/txt/draft-ietf-secsh-filexfer-02.txt) suggests that it 
has no way of changing the current working directory of the remote end, which 
is assumed to be the authenticated user's home directory. I suspect it uses a 
method similar to that used by the Net::SFTP example script psftp (i.e. changes 
to the remote cwd are recorded locally, and used to modify any relative paths). 
Have you tried the get with psftp? It might help verify that you are using 
Net::SFTP correctly.

> 
> Also, I have a test setup using another local WinXP box. Same problem, 
> results, etc.
> 
> It seems that an $ssh->cmd( 'cd $path' ) should do the deed but I 
> can't make it work, just hangs.

I'm not entirely surprised that that would not work, as Net::SFTP seems to 
create an SSH connection (I'm assuming that is what mean by $ssh) without a 
remote shell.

If the problem isn't with your code, then I can't really think of anything else 
to suggest other than fix the remote end.

HTH

--
Brian Raven 

=========================================
Atos Euronext Market Solutions Disclaimer 
=========================================

The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with 
registration no. 3962327.  Registered office address at 25 Bank Street London 
E14 5NQ United Kingdom. 
Atos Euronext Market Solutions SAS - Registered in France with registration no. 
425 100 294.  Registered office address at 6/8 Boulevard Haussmann 75009 Paris 
France.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au 
Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank 
Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré 
au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris 
et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=========================================

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to