H
Hugh Sasse Staff Elec Eng
Before I attempt to re-invent this wheel:
Has anyone come up with a method for converting an absolute
filesystem path into a relative path, given the path to relate to?
Pruning off the front is relatively easy, but handling '../'
correctly is likely to be error prone. Given that I need to cope
with Ruby 1.6 and 1.8 at the moment, and I will need to do something
graceful if the paths are on different Windows drives, well, I
suspect someone has run into this before me.
I need relative paths so I can move between data sets for testing
and between machines as well.
Thank you,
Hugh
Has anyone come up with a method for converting an absolute
filesystem path into a relative path, given the path to relate to?
Pruning off the front is relatively easy, but handling '../'
correctly is likely to be error prone. Given that I need to cope
with Ruby 1.6 and 1.8 at the moment, and I will need to do something
graceful if the paths are on different Windows drives, well, I
suspect someone has run into this before me.
I need relative paths so I can move between data sets for testing
and between machines as well.
Thank you,
Hugh