[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Behaviour of is-absolute?
From: |
James |
Subject: |
Re: Behaviour of is-absolute? |
Date: |
Mon, 25 Jan 2016 09:16:31 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
On 25/01/16 04:40, Carl Sorensen wrote:
>
> On 1/24/16 3:35 PM, "address@hidden on
> behalf of Urs Liska" <address@hidden on
> behalf of address@hidden> wrote:
>
>> Hi all,
>>
>> now that is-absolute? is not broken anymore (see #4746 and #4747) I'd
>> like to raise the question of its *behaviour* - which seems somewhat
>> inconsistent to me.
>>
>> Currently this function behaves differently on Windows and elsewhere,
>> and I think this shouldn't be the case.
>>
>> is-absolute? expects a string representing a file path.
>> It returns true if either
>>
>> it starts with a slash
>> or
>> if on Windows it starts with a drive letter.
>>
>> So
>>
>> (is-absolute? "/some/path")
>> always returns #t
>>
>> but
>> (is-absolute? "C:\some\path")
>> or
>> (is-absolute? "C:/some/path")
>>
>> returns #t on Windows but #f on Unix.
> It seems to me that "\some\path" is a "sort-of" absolute windows path. It
> is an absolute path on the current drive. It's certainly not a relative
> path in the normal sense, meaning that we need to add on the current
> directory if we want to get to an absolute path.
>
> Windows has the concept of a drive spec, (C:), unlike linux, which just
> has mount points.
>
> So I'm not sure what the best way to handle it.
>
> I guess I'm not much help.
>
> Carl
>
Don't forget that Windows has its own set of 'PATH' variable conventions
- that may or may not be applicable here - see:
https://en.wikipedia.org/wiki/Environment_variable
Under the Windows Section.
E.g. the value '%systemroot%' is - I think - the equivalent to '/' in
NIX land so you have others like %ProgramFiles% and %APPDATA% etc. That
may help with this.
James