ZnUrl directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ZnUrl directory

demarey
Hi,

I just tried to evaluate:
        (ZnUrl fromString: 'file:///tmp/') directory
and got 'tmp/' as result.

I'm a bit suprised. Shouldn't it be '/tmp/' ?
Be fore trying to fix I would like to be sure what is the expected behavior.

Thanks,
Christophe.

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ZnUrl directory

Sven Van Caekenberghe-2
ZnUrl>>#file and ZnUrl>>#directory are not well specified I guess, and maybe not that useful, but since these partially fall back to #path I am afraid you cannot just change them.

I would convert to a FileReference as in

  (ZnUrl fromString: 'file:///tmp/') asFileReference.

In short, ZnUrl is not really meant for file path manipulation.

BTW, there is a way to get what you expect

  (ZnUrl fromString: 'file:////tmp/') pathPrintString.

Now, if you find a good solution, that does not break anything else and works for all schemes, I would be interested.

> On 13 Apr 2015, at 16:43, Christophe Demarey <[hidden email]> wrote:
>
> Hi,
>
> I just tried to evaluate:
> (ZnUrl fromString: 'file:///tmp/') directory
> and got 'tmp/' as result.
>
> I'm a bit suprised. Shouldn't it be '/tmp/' ?
> Be fore trying to fix I would like to be sure what is the expected behavior.
>
> Thanks,
> Christophe.


Reply | Threaded
Open this post in threaded view
|

Re: ZnUrl directory

Tudor Girba-2
Would it not be better to simply delete these convenience methods?

Doru

On Mon, Apr 13, 2015 at 5:06 PM, Sven Van Caekenberghe <[hidden email]> wrote:
ZnUrl>>#file and ZnUrl>>#directory are not well specified I guess, and maybe not that useful, but since these partially fall back to #path I am afraid you cannot just change them.

I would convert to a FileReference as in

  (ZnUrl fromString: 'file:///tmp/') asFileReference.

In short, ZnUrl is not really meant for file path manipulation.

BTW, there is a way to get what you expect

  (ZnUrl fromString: 'file:////tmp/') pathPrintString.

Now, if you find a good solution, that does not break anything else and works for all schemes, I would be interested.

> On 13 Apr 2015, at 16:43, Christophe Demarey <[hidden email]> wrote:
>
> Hi,
>
> I just tried to evaluate:
>       (ZnUrl fromString: 'file:///tmp/') directory
> and got 'tmp/' as result.
>
> I'm a bit suprised. Shouldn't it be '/tmp/' ?
> Be fore trying to fix I would like to be sure what is the expected behavior.
>
> Thanks,
> Christophe.





--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: ZnUrl directory

demarey
In reply to this post by Sven Van Caekenberghe-2

Le 13 avr. 2015 à 17:06, Sven Van Caekenberghe a écrit :

> ZnUrl>>#file and ZnUrl>>#directory are not well specified I guess, and maybe not that useful, but since these partially fall back to #path I am afraid you cannot just change them.

Yes, I just noticed that.

> I would convert to a FileReference as in
>
>  (ZnUrl fromString: 'file:///tmp/') asFileReference.
>
> In short, ZnUrl is not really meant for file path manipulation.

Ok, good to know.

> BTW, there is a way to get what you expect
>
>  (ZnUrl fromString: 'file:////tmp/') pathPrintString.
>
> Now, if you find a good solution, that does not break anything else and works for all schemes, I would be interested.

ZnUrl>>#directory has no "real" senders. (some tests and examples)
Maybe as suggested by Doru, it should be removed and instead use a File reference?

Thanks for the reply.

>
>> On 13 Apr 2015, at 16:43, Christophe Demarey <[hidden email]> wrote:
>>
>> Hi,
>>
>> I just tried to evaluate:
>> (ZnUrl fromString: 'file:///tmp/') directory
>> and got 'tmp/' as result.
>>
>> I'm a bit suprised. Shouldn't it be '/tmp/' ?
>> Be fore trying to fix I would like to be sure what is the expected behavior.
>>
>> Thanks,
>> Christophe.
>
>


smime.p7s (5K) Download Attachment