How can we find the full path to a directory?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaymehta18
    New Member
    • Jun 2010
    • 1

    How can we find the full path to a directory?

    Hi,

    I have a piece of code which finds the symbolic links in a directory structure and then use the function readlink() to get the actual path of symbolic link.

    e.g.: i get symbolic link /home/software/myproject/bin which points to /home/software/myproject/bin-1.0

    Now there are 2 problems, readlink() returns me either the full path as metioned (/home/software/myproject/bin-1.0) or it just gives me back bin-1.0 (link could be created only on folder bin-1.0 using command prompt).

    My problem is that i want always the full path. Please let me know how can i find the full path after readlink() gives me the directory name only.

    Is there a way i can find the full path from just directory name?

    Regards,
    Jay
Working...