1

I would like to remove all "./", or "../" from a input file path string. I know that "realpath" removes NOT only "./", or "../" BUT also symbolic link.

Is there a library to remove all "./", or "../" from a input file path string and return the path without "./", or "../"? //DAUM

CL.
  • 173,858
  • 17
  • 217
  • 259
Happy
  • 133
  • 8
  • I have posted a [solution](http://stackoverflow.com/a/34202207/3744681) that I use for this purpose in that thread with example. It should work for you. – Jahid Dec 10 '15 at 12:50
  • Thanks; it should work. – Happy Dec 11 '15 at 02:16
  • Should I use "canonicalize_filename" library which describe is at http://linux.die.net/man/3/canonicalize_filename? – Happy Dec 11 '15 at 03:34
  • `canonicalize_filename` should work fine too... ( I haven't used it though..) – Jahid Dec 11 '15 at 08:18

0 Answers0