|
Re: relative path from one absolute path to another? [message #49709 is a reply to message #49680] |
Fri, 11 August 2006 01:14  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
JD Smith <jdsmith@as.arizona.edu> writes:
> On Wed, 09 Aug 2006 15:17:15 -0400, Craig Markwardt wrote:
>> JD Smith <jdsmith@as.arizona.edu> writes:
>>> Does it work for Windows paths (with c:\foo or \\host\foo)?
>>
>> Sure. Of course, if the drive letter is different, there is no
>> possible relative path.
>
> So you explicitly test for and separate out the drive letter and then
> prepend it later? I didn't see where you do this (and I don't have any
> Windows IDL at hand to test these things).
No explicit test was needed. :-)
>
>> Regarding links and FILE_SAME(), I didn't assume the directories
>> actually exist on disk. In my case, sometimes the relative path is
>> devised before the tree exists, so that assumption would have failed.
>
> It's not a problem, because FILE_SAME returns true if the two files are
> lexically identical, even if they don't exist, so you get the best of both
> worlds.
Huh! OK.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: relative path from one absolute path to another? [message #49713 is a reply to message #49680] |
Thu, 10 August 2006 15:33  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Wed, 09 Aug 2006 15:17:15 -0400, Craig Markwardt wrote:
> JD Smith <jdsmith@as.arizona.edu> writes:
>> Does it work for Windows paths (with c:\foo or \\host\foo)?
>
> Sure. Of course, if the drive letter is different, there is no
> possible relative path.
So you explicitly test for and separate out the drive letter and then
prepend it later? I didn't see where you do this (and I don't have any
Windows IDL at hand to test these things).
> Regarding links and FILE_SAME(), I didn't assume the directories
> actually exist on disk. In my case, sometimes the relative path is
> devised before the tree exists, so that assumption would have failed.
It's not a problem, because FILE_SAME returns true if the two files are
lexically identical, even if they don't exist, so you get the best of both
worlds.
JD
|
|
|