1

I am using this code to get absolute path of a file:

String getAbsolutePath(String x){
    char path[FILENAME_MAX+1];
    realpath(x.c_str(),path);
    return toString(path);

}

But the realpath() function resolves symlinks too. How can I not resolve the symlinks i.e get the path of the symlink itself (not the file pointed to by the link)?

Claudio
  • 10,614
  • 4
  • 31
  • 71
Jahid
  • 21,542
  • 10
  • 90
  • 108

0 Answers0