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. 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. Sturdy -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Raven Sent: Friday, May 16, 2008 1:02 PM To: perl-win32-users Subject: RE: How to change dir using SFTP or SSH From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sturdevant, Robert W Mr CTR USA AMC Sent: 16 May 2008 15:55 To: perl-win32-users Subject: How to change dir using SFTP or SSH > Hi list, > > I have a perl (5.6) SFTP client (Net::SFTP) that gets and puts files using either a full or relative path with > the filename something like this > > $sftp->get( $remotename, $localname ); # where $remotename = '/Home/OUT/myfile.txt' > > But I have a remote system (a unix box) that rejects the path and requires a chdir to the correct directory. To > fetch a file I need to do something like this > > $sftp->chdir( $path ); #cd to the folder > $sftp->get( $shortname, $localname); # get the file using only the file name > > I see no way to do $sftp->chdir. Please advise if something similar is possible. I have tried many combinations > of commands such as $ssh->cmd( 'cd $path' ) with no joy. $ssh->cmd() always seems to hang. TIA. Are you sure that you have the correct path, the file exists, and the user you are using has appropriate permissions? You don't give the reason that your path was rejected, but it is likely to be one of those. I could be wrong, but I don't think that being able to chdir (which I don't think you can) would make any difference. As this is a win32 list, don't forget that unix file systems are usually case sensitive, unlike win32. 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