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

Posted on 2005-02-26
Medium Priority
Last Modified: 2012-05-05
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.
Question by:tazrebel
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 25

Expert Comment

ID: 13412566
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.

Author Comment

ID: 13412880
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.
LVL 25

Accepted Solution

jrb1 earned 1500 total points
ID: 13412952
Yep, that would do it.  To close a question, you have to post over and support and request them to do it.

Author Comment

ID: 13413096
Hmmm......  How about i just give you the points since you were nice enough to respond. Thanks!

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Starting up a Project
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question