Login  Register

comparing FileReference

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

comparing FileReference

Martin Bähr
169 posts
hi,

i can't seem to figure out how to normalizethe path of a FileReference
i am trying to compare
FileSystem disk root / 'local/lib'
with
Filesystem disk workingDirectory / '..'

but they don't match because the latter produces:
File @ '/local/lib/pharo4/..'

i'd expect to be able to compare two references as equal if they point to the
same directory on disk, regardless of the path getting there.

is there any way to accomplish that?

greetings, martin.

--
eKita                   -   the online platform for your entire academic life
--
chief engineer                                                       eKita.co
pike programmer      pike.lysator.liu.se    caudium.net     societyserver.org
secretary                                                      beijinglug.org
mentor                                                           fossasia.org
foresight developer  foresightlinux.org                            realss.com
unix sysadmin
Martin Bähr          working in china        http://societyserver.org/mbaehr/

Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: comparing FileReference

Sven Van Caekenberghe-2
5697 posts
Hi Martin,

This is a valid question, as far as I can see, FileSystem does not resolve .. itself and leaves that to the underlying OS.

Maybe we should turn this into an issue ?

Sven

> On 24 Jan 2015, at 09:37, Martin Bähr <[hidden email]> wrote:
>
> hi,
>
> i can't seem to figure out how to normalizethe path of a FileReference
> i am trying to compare
> FileSystem disk root / 'local/lib'
> with
> Filesystem disk workingDirectory / '..'
>
> but they don't match because the latter produces:
> File @ '/local/lib/pharo4/..'
>
> i'd expect to be able to compare two references as equal if they point to the
> same directory on disk, regardless of the path getting there.
>
> is there any way to accomplish that?
>
> greetings, martin.
>
> --
> eKita                   -   the online platform for your entire academic life
> --
> chief engineer                                                       eKita.co
> pike programmer      pike.lysator.liu.se    caudium.net     societyserver.org
> secretary                                                      beijinglug.org
> mentor                                                           fossasia.org
> foresight developer  foresightlinux.org                            realss.com
> unix sysadmin
> Martin Bähr          working in china        http://societyserver.org/mbaehr/
>