[squeak-dev] Re: FileDirectory from a relative path

Randal L. Schwartz merlyn at stonehenge.com
Thu Sep 17 05:49:05 UTC 2009


>>>>> "Miguel" == Miguel Enrique Cobá Martinez <miguel.coba at gmail.com> writes:

Miguel> Thanks Andreas, but this line outputs a string with the resolved
Miguel> absolute path. That is ok but not what I need. I need a FileDirectory
Miguel> object built from a string containing a relative unix path.

The *real* question is are you dealing with abstract paths, or real
disks that might have symlinks.

The problem comes about when you ask to reduce:

    /xxx/yyy/../zzz

for which, if "yyy" was made with "ln -s /aaa/bbb /xxx/yyy",
then the proper answer is:

    /aaa/zzz

Yeah.  You can't just look at the text of the string to reduce it.  You have
to ask the operating system where the heck you are.

So again, are you dealing with abstract paths that will *never* go near
a filesystem, or are you dealing with an *actual* filesystem?   And
answer carefully, for if you answer wrong, you will be burned.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion



More information about the Squeak-dev mailing list