Warren Brown wrote:

> Hugh,
> 
> 
>>Has anyone come up with a method for converting
>>an absolute filesystem path into a relative
>>path, given the path to relate to?
> 
> 
>     Well, this doesn't handle Windows drive letters, but it handles the
> rest:
> 
> # Convert the given absolute path into a path
> # relative to the second given absolute path.
> def relativepath(abspath,relativeto)
>   path = abspath.split(File::SEPARATOR)
>   rel  = relativeto.split(File::SEPARATOR)
>   while (path.length > 0) && (path.first == rel.first)
>     path.shift
>     rel.shift
>   end
>   ('..' + File::SEPARATOR) * (rel.length - 1) + path.join(File::SEPARATOR)
> end

Your relative path routine is MUCH more efficient than mine, geez.  I 
still don't "think" with everything Ruby has to offer.  I'm still too 
much of a "got-no-libs" C/C++ person.  =)

	Sean O'Dell