[SFTPdll] how to get current remote directory - WeOnlyDo Discussion board

[SFTPdll] how to get current remote directory (General questions)

by Binh NGUYEN, Monday, February 21, 2011, 11:13 (5023 days ago)

Hi all,

Can anyone tell me how to get the current remote working directory as the command pwd does?
We find RemotePath property but it's just applied to file transfer (get,put).
Is there any method to work around?

Thanks,

Binh

Re: [SFTPdll] how to get current remote directory

by wodDamir, Monday, February 21, 2011, 12:59 (5023 days ago) @ Binh NGUYEN

Hi Binh,

You can send PWD command manually using RawSend method. However, there's basically no need, since the component *ALWAYS* uses absolute paths for methods.

I.e.:

wodSFTP1.ListDir /home/userDir/

Regards,
Damba

Re: [SFTPdll] how to get current remote directory

by Binh NGUYEN, Monday, February 21, 2011, 15:50 (5022 days ago) @ wodDamir

Thanks Damir,

I'm sorry but we're using SFtpDLL API for Visual C++.

All methods begin with Sftp_ , for example Sftp_Connect. We cannot any method which contains RawSend. Is there something wrong?

Regards,

Binh

Re: [SFTPdll] how to get current remote directory

by wodDamir, Monday, February 21, 2011, 16:04 (5022 days ago) @ Binh NGUYEN

Binh,

Sorry, I made a mistake in my previous reply. The RawSend is in our FTP component.

However, you can try using RealPath method, and supply it . as an argument. This should return your current path.

Regards,
Damba