Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Aug 2006 13:27:49 +0100
From:      "mal content" <artifact.one@googlemail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Path transformation
Message-ID:  <8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello.

Is there any code in the tree that does general path transformation
or 'optimisation'?

For example, this path corresponds to the current working directory:

  "dir1/dir2/dir3/../../../"

So I'd like to be able to pass that to a function and get the optimised
result of:

  "."

And so on for paths such as:

  "dir1/dir2/dir3/../../../../"

(Which obviously becomes "..").

  "dir1/dir2/dir3/../../../dir1"

(Optimised to "dir1").

  "dir1/dir2/dir3/../../../dir1/file.txt"

("dir1/file.txt")

It's giving me a real headache trying to work out the algorithm
to do this.

thanks,
MC



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8e96a0b90608190527p3a2b9b90hf18b4a0f947cffec>