obtaining a FileUrl through String>>asUrl

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

obtaining a FileUrl through String>>asUrl

Tudor Girba-2
Hi,

I am trying to get to a FileUrl via the polymorphic asUrl call, but it seems I am doing something wrong.

I do:
'file:d:\' asUrl

but the problem seems that $: and $\ are mangled, because when I print, I get:
file:///d%3A%5C

Furthermore:
'file:d:\' asUrl asFileReference exists ==> false

but, at the same time:
'd:\' asFileReference exists ==> true

Can anyone tell me where is the mistake?

Btw, the reason I am looking for this is that I would like to use the ZeroConf support to load a configuration from a directory Monticello repository and to do that I have to pass a url to the command line.

Cheers,
Doru

--

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

Re: obtaining a FileUrl through String>>asUrl

Camillo Bruni-3

On 2013-03-28, at 14:44, Tudor Girba <[hidden email]> wrote:

> Hi,
>
> I am trying to get to a FileUrl via the polymorphic asUrl call, but it
> seems I am doing something wrong.
>
> I do:
> 'file:d:\' asUrl
>
> but the problem seems that $: and $\ are mangled, because when I print, I
> get:
> file:///d%3A%5C
>
> Furthermore:
> 'file:d:\' asUrl asFileReference exists ==> false
>
> but, at the same time:
> 'd:\' asFileReference exists ==> true
>
> Can anyone tell me where is the mistake?
>
> Btw, the reason I am looking for this is that I would like to use the
> ZeroConf support to load a configuration from a directory Monticello
> repository and to do that I have to pass a url to the command line.


I guess that will work out of the box under linux.
I think the URL parsing with the directory letter under windows is broken.
And I bet there is no test catching that either.

Did you try the following?
'file://d:/' asUrl
'file:d:/' asUrl

Reply | Threaded
Open this post in threaded view
|

Re: obtaining a FileUrl through String>>asUrl

Tudor Girba-2
'file:d:/' asUrl ==> file:///d%3A/
'file://d:/' asUrl ==> file://d:/ 

The second looks nice, but:
'file://d:/' asUrl asFileReference ==>  File @ 

The problem seems to be that:
'file://d:/' asUrl pathString ==> ''

:(

Cheers,
Doru

On Thu, Mar 28, 2013 at 2:50 PM, Camillo Bruni <[hidden email]> wrote:

On 2013-03-28, at 14:44, Tudor Girba <[hidden email]> wrote:

> Hi,
>
> I am trying to get to a FileUrl via the polymorphic asUrl call, but it
> seems I am doing something wrong.
>
> I do:
> 'file:d:\' asUrl
>
> but the problem seems that $: and $\ are mangled, because when I print, I
> get:
> file:///d%3A%5C
>
> Furthermore:
> 'file:d:\' asUrl asFileReference exists ==> false
>
> but, at the same time:
> 'd:\' asFileReference exists ==> true
>
> Can anyone tell me where is the mistake?
>
> Btw, the reason I am looking for this is that I would like to use the
> ZeroConf support to load a configuration from a directory Monticello
> repository and to do that I have to pass a url to the command line.


I guess that will work out of the box under linux.
I think the URL parsing with the directory letter under windows is broken.
And I bet there is no test catching that either.

Did you try the following?
'file://d:/' asUrl
'file:d:/' asUrl




--

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

Re: obtaining a FileUrl through String>>asUrl

Marcus Denker-4

On Mar 28, 2013, at 3:13 PM, Tudor Girba <[hidden email]> wrote:

> 'file:d:/' asUrl ==> file:///d%3A/
> 'file://d:/' asUrl ==> file://d:/
>
> The second looks nice, but:
> 'file://d:/' asUrl asFileReference ==>  File @
>
> The problem seems to be that:
> 'file://d:/' asUrl pathString ==> ''
>
> :(

was Url ever integrated with FileSystem?
I know there was some work for ZnUrl...

        Marcus


Reply | Threaded
Open this post in threaded view
|

Re: obtaining a FileUrl through String>>asUrl

Camillo Bruni-3
In reply to this post by Tudor Girba-2
ok that IS broken then :/
could you open an issue?

On 2013-03-28, at 15:08, Tudor Girba <[hidden email]> wrote:

> 'file:d:/' asUrl ==> file:///d%3A/
> 'file://d:/' asUrl ==> file://d:/
>
> The second looks nice, but:
> 'file://d:/' asUrl asFileReference ==>  File @
>
> The problem seems to be that:
> 'file://d:/' asUrl pathString ==> ''
>
> :(
>
> Cheers,
> Doru
>
> On Thu, Mar 28, 2013 at 2:50 PM, Camillo Bruni <[hidden email]>wrote:
>
>>
>> On 2013-03-28, at 14:44, Tudor Girba <[hidden email]> wrote:
>>
>>> Hi,
>>>
>>> I am trying to get to a FileUrl via the polymorphic asUrl call, but it
>>> seems I am doing something wrong.
>>>
>>> I do:
>>> 'file:d:\' asUrl
>>>
>>> but the problem seems that $: and $\ are mangled, because when I print, I
>>> get:
>>> file:///d%3A%5C
>>>
>>> Furthermore:
>>> 'file:d:\' asUrl asFileReference exists ==> false
>>>
>>> but, at the same time:
>>> 'd:\' asFileReference exists ==> true
>>>
>>> Can anyone tell me where is the mistake?
>>>
>>> Btw, the reason I am looking for this is that I would like to use the
>>> ZeroConf support to load a configuration from a directory Monticello
>>> repository and to do that I have to pass a url to the command line.
>>
>>
>> I guess that will work out of the box under linux.
>> I think the URL parsing with the directory letter under windows is broken.
>> And I bet there is no test catching that either.
>>
>> Did you try the following?
>> 'file://d:/' asUrl
>> 'file:d:/' asUrl
>>
>>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"


Reply | Threaded
Open this post in threaded view
|

Re: obtaining a FileUrl through String>>asUrl

Sven Van Caekenberghe-2
In reply to this post by Tudor Girba-2
Hi Doru,

On 28 Mar 2013, at 15:08, Tudor Girba <[hidden email]> wrote:

> 'file:d:/' asUrl ==> file:///d%3A/
> 'file://d:/' asUrl ==> file://d:/
>
> The second looks nice, but:
> 'file://d:/' asUrl asFileReference ==>  File @
>
> The problem seems to be that:
> 'file://d:/' asUrl pathString ==> ''
>
> :(

You could try a bit with the extension methods in the package Zinc-Resource-Meta-FileSystem in Pharo 2.0

'file:///c:/' asZnUrl asFileReference  ==> File @ /c:

But Windows File URLs are a big mess ;-)

So, any help is greatly appreciated, but do also check specifications.

Sven

> Cheers,
> Doru
>
> On Thu, Mar 28, 2013 at 2:50 PM, Camillo Bruni <[hidden email]> wrote:
>
> On 2013-03-28, at 14:44, Tudor Girba <[hidden email]> wrote:
>
> > Hi,
> >
> > I am trying to get to a FileUrl via the polymorphic asUrl call, but it
> > seems I am doing something wrong.
> >
> > I do:
> > 'file:d:\' asUrl
> >
> > but the problem seems that $: and $\ are mangled, because when I print, I
> > get:
> > file:///d%3A%5C
> >
> > Furthermore:
> > 'file:d:\' asUrl asFileReference exists ==> false
> >
> > but, at the same time:
> > 'd:\' asFileReference exists ==> true
> >
> > Can anyone tell me where is the mistake?
> >
> > Btw, the reason I am looking for this is that I would like to use the
> > ZeroConf support to load a configuration from a directory Monticello
> > repository and to do that I have to pass a url to the command line.
>
>
> I guess that will work out of the box under linux.
> I think the URL parsing with the directory letter under windows is broken.
> And I bet there is no test catching that either.
>
> Did you try the following?
> 'file://d:/' asUrl
> 'file:d:/' asUrl
>
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"



--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply | Threaded
Open this post in threaded view
|

Re: obtaining a FileUrl through String>>asUrl

Tudor Girba-2
Hi Sven,

Thanks. I will give it a try next week.

@Camillo: In the meantime, I opened an issue:
https://pharo.fogbugz.com/f/cases/10180/Obtaining-a-FileReference-through-String-asUrl-should-work-on-Windows

I am not sure I did it right. Could you check and let me know if there is anything I missed in the entry (I mean from the point of view of the meta-data, not of the description)?

Cheers,
Doru


On Mar 28, 2013, at 5:20 PM, Sven Van Caekenberghe <[hidden email]> wrote:

> Hi Doru,
>
> On 28 Mar 2013, at 15:08, Tudor Girba <[hidden email]> wrote:
>
>> 'file:d:/' asUrl ==> file:///d%3A/
>> 'file://d:/' asUrl ==> file://d:/
>>
>> The second looks nice, but:
>> 'file://d:/' asUrl asFileReference ==>  File @
>>
>> The problem seems to be that:
>> 'file://d:/' asUrl pathString ==> ''
>>
>> :(
>
> You could try a bit with the extension methods in the package Zinc-Resource-Meta-FileSystem in Pharo 2.0
>
> 'file:///c:/' asZnUrl asFileReference  ==> File @ /c:
>
> But Windows File URLs are a big mess ;-)
>
> So, any help is greatly appreciated, but do also check specifications.
>
> Sven
>
>> Cheers,
>> Doru
>>
>> On Thu, Mar 28, 2013 at 2:50 PM, Camillo Bruni <[hidden email]> wrote:
>>
>> On 2013-03-28, at 14:44, Tudor Girba <[hidden email]> wrote:
>>
>>> Hi,
>>>
>>> I am trying to get to a FileUrl via the polymorphic asUrl call, but it
>>> seems I am doing something wrong.
>>>
>>> I do:
>>> 'file:d:\' asUrl
>>>
>>> but the problem seems that $: and $\ are mangled, because when I print, I
>>> get:
>>> file:///d%3A%5C
>>>
>>> Furthermore:
>>> 'file:d:\' asUrl asFileReference exists ==> false
>>>
>>> but, at the same time:
>>> 'd:\' asFileReference exists ==> true
>>>
>>> Can anyone tell me where is the mistake?
>>>
>>> Btw, the reason I am looking for this is that I would like to use the
>>> ZeroConf support to load a configuration from a directory Monticello
>>> repository and to do that I have to pass a url to the command line.
>>
>>
>> I guess that will work out of the box under linux.
>> I think the URL parsing with the directory letter under windows is broken.
>> And I bet there is no test catching that either.
>>
>> Did you try the following?
>> 'file://d:/' asUrl
>> 'file:d:/' asUrl
>>
>>
>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Every thing has its own flow"
>
>
>
> --
> Sven Van Caekenberghe
> http://stfx.eu
> Smalltalk is the Red Pill
>
>

--
www.tudorgirba.com

"When people care, great things can happen."




Reply | Threaded
Open this post in threaded view
|

Re: obtaining a FileUrl through String>>asUrl

Camillo Bruni-3

On 2013-03-30, at 12:32, Tudor Girba <[hidden email]> wrote:

> Hi Sven,
>
> Thanks. I will give it a try next week.
>
> @Camillo: In the meantime, I opened an issue:
> https://pharo.fogbugz.com/f/cases/10180/Obtaining-a-FileReference-through-String-asUrl-should-work-on-Windows
>
> I am not sure I did it right. Could you check and let me know if there is anything I missed in the entry (I mean from the point of view of the meta-data, not of the description)?

looks good!

> Cheers,
> Doru
>
>
> On Mar 28, 2013, at 5:20 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
>> Hi Doru,
>>
>> On 28 Mar 2013, at 15:08, Tudor Girba <[hidden email]> wrote:
>>
>>> 'file:d:/' asUrl ==> file:///d%3A/
>>> 'file://d:/' asUrl ==> file://d:/
>>>
>>> The second looks nice, but:
>>> 'file://d:/' asUrl asFileReference ==>  File @
>>>
>>> The problem seems to be that:
>>> 'file://d:/' asUrl pathString ==> ''
>>>
>>> :(
>>
>> You could try a bit with the extension methods in the package Zinc-Resource-Meta-FileSystem in Pharo 2.0
>>
>> 'file:///c:/' asZnUrl asFileReference  ==> File @ /c:
>>
>> But Windows File URLs are a big mess ;-)
>>
>> So, any help is greatly appreciated, but do also check specifications.
>>
>> Sven
>>
>>> Cheers,
>>> Doru
>>>
>>> On Thu, Mar 28, 2013 at 2:50 PM, Camillo Bruni <[hidden email]> wrote:
>>>
>>> On 2013-03-28, at 14:44, Tudor Girba <[hidden email]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to get to a FileUrl via the polymorphic asUrl call, but it
>>>> seems I am doing something wrong.
>>>>
>>>> I do:
>>>> 'file:d:\' asUrl
>>>>
>>>> but the problem seems that $: and $\ are mangled, because when I print, I
>>>> get:
>>>> file:///d%3A%5C
>>>>
>>>> Furthermore:
>>>> 'file:d:\' asUrl asFileReference exists ==> false
>>>>
>>>> but, at the same time:
>>>> 'd:\' asFileReference exists ==> true
>>>>
>>>> Can anyone tell me where is the mistake?
>>>>
>>>> Btw, the reason I am looking for this is that I would like to use the
>>>> ZeroConf support to load a configuration from a directory Monticello
>>>> repository and to do that I have to pass a url to the command line.
>>>
>>>
>>> I guess that will work out of the box under linux.
>>> I think the URL parsing with the directory letter under windows is broken.
>>> And I bet there is no test catching that either.
>>>
>>> Did you try the following?
>>> 'file://d:/' asUrl
>>> 'file:d:/' asUrl
>>>
>>>
>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "Every thing has its own flow"
>>
>>
>>
>> --
>> Sven Van Caekenberghe
>> http://stfx.eu
>> Smalltalk is the Red Pill
>>
>>
>
> --
> www.tudorgirba.com
>
> "When people care, great things can happen."
>
>
>
>