Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

How do you move up a level in the ftp direcotry using FtpSetCurrentDirectory

I can get to the directory i want by moving down but how do i move up in the directory. For example i can move through a directory structure like this:


I am using a function that looks like this:

Public Sub rcd(pszDir As String)
    Dim sPathFromRoot As String
    Dim bRet As Boolean
    sPathFromRoot = pszDir
    If sPathFromRoot = "" Then sPathFromRoot = "/"
    bRet = FtpSetCurrentDirectory(hConnection, sPathFromRoot)
End Sub

Using this i can easily start at automobile and get to any of the lower vehicles by calling the routine 'rcd' and passing the desired lower directory. However, if i am in the 'blazer' directory i cant figure out how to move back so i can get to the
durango directory.

Am i using the wrong call? I'm in a bind and could really use the help. Thanks in advance.
  • 2
  • 2
1 Solution
Can't you pass ".." as the Path From Root?  I may try testing that later, but would expect that to be one way to do it.

Another would be to take the current directory (FtpGetCurrentDirectory) and then strip off the last node and set the directory using the full path.
tazrebelAuthor Commented:
Ya i tried that but it didnt help. I managed to figure it out. The probelem was that the connection object was going out of scope so i was losing the handle to the ftp connection.

This question can be closed.
Yep, that would do it.  To close a question, you have to post over and support and request them to do it.
tazrebelAuthor Commented:
Hmmm......  How about i just give you the points since you were nice enough to respond. Thanks!

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now