Trond wrote:Yes, you must change directories one at a time, it's clearly spelled out in the manual (and is the case for all ftp connections as far as I know). This means that if you're in /some/subdirectory/deep/down then SetFTPDirectory("/") is invalid. This should be obvious, as it's clearly trying to change multiple levels at a time.
To get to the root use SetFTPDirectory("..") several times ....
Actually, Trond, SetFTPDirectory(Connect,"/") is completely valid to return to the root directory. Test it, you will see.
Yes, SetFTPConnection(Connect,"/example/test/files") is invalid. It requires three separate SetFTPConnection commands to accomplish the change
Code: Select all
ServerDirectory$ = "/example/test/files"
For Ctr = 2 To CountString(ServerDirectory$, "/")+1
SetFTPDirectory(Connect, StringField(ServerDirectory$,Ctr,"/"))
Next
After that a GetFTPDirectory(Connect) would return "/example/test/files/".
Then issue a
and after that a GetFTPDirectory(Connect) would return "/".
Again, if the current directory is "/example/test/files" then
a SetFTPDirectory(Connect,"/example") is completely OK.
But a SetFTPDirectory(Connect,"/example/test") is not correct.
PB's SetFTPDirectory() command does not support
subpaths. This may be on
purpose because I have seen some FTP servers that won't handle subpath changes
that way too.
I've recently checked issuing subpath CDs manually on my two main servers and
both of them accepted the command and changed directories correctly. FTP
servers continue to be a challenge after all these years.