Getting the initial remote path - WeOnlyDo Discussion board

Getting the initial remote path (General questions)

by ManhMike, Friday, September 09, 2005, 17:15 (7014 days ago)

I have an interesting dilemma and have yet to find a solution.

When I connect to a remote server, I am dropped in a home directory which is several levels deep, i.e. /aaa/bbb/ccc/ddd

However, when I connect to the server, the control treats /aaa/bbb/ccc/ddd as the ftp root, i.e. /

I need to specify relative paths in the in the get and put operations, so I can upload and download to paths BELOW the ftp root.

Obviously, relative paths aren't allowed. I could easily extrapolate where the user needs to be and feed the control the appropriate absolute paths, however I can't find a way to determine my ACTUAL location upon connection.

Is this even possible? If so, could someone point me in the right direction?

Thanks!

Re: Getting the initial remote path

by wodSupport, Friday, September 09, 2005, 17:34 (7014 days ago) @ ManhMike

Mike,

did you try reading RemotePath property upon connection? It should hold your home dir.

Re: Getting the initial remote path

by ManhMike, Friday, September 09, 2005, 21:06 (7014 days ago) @ wodSupport

Ahh, that worked, sort of.

The issue I have encountered involves a chrooted environment, where I am placed into a certain subdirectory at connection.

In this instance, both my FTP client and wodFtpDLX say that I am located in / (which is actually something like /aaa/bbb/home/ ).

Of course, *I* know where I am in the filesystem, but programatically I have no way to find this out.

In my FTP client I can manually back up and get out of the home directory, revealing the true path as I continually issue a ChDir .. command. The ftp control doesn't allow me to do this, at least, not under SFTP.

I have discovered that some FTP server software (i.e. ProFTPd) allows me to reveal the full path, however this is not always an option.

There seems to be a serious limitation in wodFtpDLX in that I am stuck unless I KNOW the full path or my FTP server is configured to reveal it.

Am I stuck or is there a workaround?

Re: Getting the initial remote path

by wodSupport, Friday, September 09, 2005, 21:07 (7014 days ago) @ ManhMike

Dir you try to call ListDir ( /../../ ) for example?

In SFTP there's no 'current dir' term at all. But in FTP you could use RawSend to send CD .. command if you think that would help.

As for SFTP - this isn't limitation of wodFtpDLX, but of SFTP in general.

Re: Getting the initial remote path

by ManhMike, Friday, September 09, 2005, 22:25 (7014 days ago) @ wodSupport

Ok, I'll give that a shot.

Also, I'm wondering why I can issue Raw commands under standard FTP, but not SFTP.


Thanks again,
Mike

Re: Getting the initial remote path

by wodSupport, Friday, September 09, 2005, 22:27 (7014 days ago) @ ManhMike

Because of the nature of SFTP. It's nothing like FTP, there are no commands to execute, it's packet oriented.

Re: Getting the initial remote path

by ManhMike, Friday, September 09, 2005, 23:20 (7014 days ago) @ wodSupport

Although it's packet based, I can perform many of the same operations in FTP and SFTP, be it with a client app or with your control.

Using a client, such as CoreFTP, I navigate directory structure the same way regardless of whether I am connected to an FTP or SFTP server. With that said, hopefully you can understand why I'm a little confused/puzzled. :)

Re: Getting the initial remote path

by wodSupport, Friday, September 09, 2005, 23:23 (7014 days ago) @ ManhMike

Mike,

there's no CD command in SFTP protocol. Whatever function is performed (file list, file upload....) full paths are to be specified, that's in protocol specification. So, they probably also do try to specify .. directory. I can't say exactly since I haven't tried that program.