[racket] reliable path comparison?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Oct 21 01:51:41 EDT 2010

IIUC, the only reliable way to do this is to open the two files.

Robby

On Wed, Oct 20, 2010 at 10:38 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
>>> I'm trying to compare two paths for equality; I misread
>>> normalize-path and didn't realize that it does not do case folding,
>>> so that on Windows,
>>>
>>>    (equal? (build-path "C:\\")
>>>               (build-path "c:\\"))
>>>
>>> returns false.  What's the right way to compare paths for equality?
>>
>> IIRC, there was no right way -- I think that on windows you can have
>> some drives be case-sensitive and some are not.
>
>
> Yikes.  Ok, is there a way to tell if a filesystem root is
> case-sensitive or not?
>
>
>
>>> As a related question, what's the right way to see if one directory
>>> is a subdirectory of another?
>>
>> Explode the two and check if one is a prefix of the other?
>
> Thank you; that appears to work for me.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users


Posted on the users mailing list.