1

I have an application that deals with files, and some files refer to other ones. Then I have to create relative paths, and also know whether a file has already been processed.

I want to 'canonicalize' the filename, removing references to '.' and '..', but keeping symbolic links, so realpath() and boost::filesystem::canonical() do not fit, as they remove also symbolic links, and I want to keep their structure.

I have coded some functions, but they are complicated, not perfect, and only work on POSIX. I wanted to know a more standard way of doing that.

abligh
  • 24,573
  • 4
  • 47
  • 84
rod
  • 11
  • 2
  • I understand. But I think there is a consistent way for normalize to behave: the same one that would be done when on the shell and doing cd x/y/z; cd ..; cd t; etc. – rod Jan 21 '14 at 21:33
  • To @abligh it may be related to C. If there is code that does the conversion it may be helpful even if written in C. It mentions boost but isn't exclusive. – rod Jan 21 '14 at 21:35
  • What the shell does depends on the state of the `set -o physical` option. – Rob Kennedy Jan 21 '14 at 21:54

0 Answers0