Problem with FileSystem primitives in latest Pharo2.0

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

Problem with FileSystem primitives in latest Pharo2.0

Fernando olivero-2
Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
that prevents from using Gofer and monticello.

Its related to the FileSystem primitives, when trying to delete a file.

To reproduce evaluate the following code ( change 'PharoDebug.log' for
any existing file in the same directory as the image).

| path |
path := FileSystem disk workingDirectory.
p := FilePluginPrims new .
p  deleteDirectory: (path / 'PharoDebug.log') fullName.


Any idea why?

Thanks,
Fernando

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Marcus Denker-4
Are you using a current VM from Jenkins?

I think FileSystem needs some fixes in the Vm File plugin...

On Jul 4, 2012, at 9:23 AM, Fernando Olivero wrote:

> Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
> that prevents from using Gofer and monticello.
>
> Its related to the FileSystem primitives, when trying to delete a file.
>
> To reproduce evaluate the following code ( change 'PharoDebug.log' for
> any existing file in the same directory as the image).
>
> | path |
> path := FileSystem disk workingDirectory.
> p := FilePluginPrims new .
> p  deleteDirectory: (path / 'PharoDebug.log') fullName.
>
>
> Any idea why?
>
> Thanks,
> Fernando
>

--
Marcus Denker -- http://marcusdenker.de


Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Sven Van Caekenberghe
In reply to this post by Fernando olivero-2
Why not

        (FileSystem disk workingDirectory / 'foo.txt') delete.

Works for me.

Are you sure you are using the latest VM ?

On 04 Jul 2012, at 09:23, Fernando Olivero wrote:

> Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
> that prevents from using Gofer and monticello.
>
> Its related to the FileSystem primitives, when trying to delete a file.
>
> To reproduce evaluate the following code ( change 'PharoDebug.log' for
> any existing file in the same directory as the image).
>
> | path |
> path := FileSystem disk workingDirectory.
> p := FilePluginPrims new .
> p  deleteDirectory: (path / 'PharoDebug.log') fullName.
>
>
> Any idea why?
>
> Thanks,
> Fernando
>


Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Fernando olivero-2
In reply to this post by Fernando olivero-2
Yes, i'm using the latest VM's from Jenkins.

I've tried with both Cog and NB vm's.

It appears to be related to the (internal) FilePlugin, did esteban
make changes to it?

Surely this happened to somebody else? When trying to load/merge/commit ?

Fernando


On Wed, Jul 4, 2012 at 9:28 AM, Marcus Denker <[hidden email]> wrote:

> Are you using a current VM from Jenkins?
>
> I think FileSystem needs some fixes in the Vm File plugin...
>
> On Jul 4, 2012, at 9:23 AM, Fernando Olivero wrote:
>
>> Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
>> that prevents from using Gofer and monticello.
>>
>> Its related to the FileSystem primitives, when trying to delete a file.
>>
>> To reproduce evaluate the following code ( change 'PharoDebug.log' for
>> any existing file in the same directory as the image).
>>
>> | path |
>> path := FileSystem disk workingDirectory.
>> p := FilePluginPrims new .
>> p  deleteDirectory: (path / 'PharoDebug.log') fullName.
>>
>>
>> Any idea why?
>>
>> Thanks,
>> Fernando
>>
>
> --
> Marcus Denker -- http://marcusdenker.de
>

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

EstebanLM
yes, I made changes... but not delete related.
I will check it.

Esteban

On Jul 4, 2012, at 9:32 AM, Fernando Olivero wrote:

> Yes, i'm using the latest VM's from Jenkins.
>
> I've tried with both Cog and NB vm's.
>
> It appears to be related to the (internal) FilePlugin, did esteban
> make changes to it?
>
> Surely this happened to somebody else? When trying to load/merge/commit ?
>
> Fernando
>
>
> On Wed, Jul 4, 2012 at 9:28 AM, Marcus Denker <[hidden email]> wrote:
>> Are you using a current VM from Jenkins?
>>
>> I think FileSystem needs some fixes in the Vm File plugin...
>>
>> On Jul 4, 2012, at 9:23 AM, Fernando Olivero wrote:
>>
>>> Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
>>> that prevents from using Gofer and monticello.
>>>
>>> Its related to the FileSystem primitives, when trying to delete a file.
>>>
>>> To reproduce evaluate the following code ( change 'PharoDebug.log' for
>>> any existing file in the same directory as the image).
>>>
>>> | path |
>>> path := FileSystem disk workingDirectory.
>>> p := FilePluginPrims new .
>>> p  deleteDirectory: (path / 'PharoDebug.log') fullName.
>>>
>>>
>>> Any idea why?
>>>
>>> Thanks,
>>> Fernando
>>>
>>
>> --
>> Marcus Denker -- http://marcusdenker.de
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Fernando olivero-2
In reply to this post by Fernando olivero-2
Hi Sven, yes is working.

I found the error. Try evaluating the code WHEN the file is un-existing.

2 timesRepeat:[ (FileSystem disk workingDirectory /
'unexistingFileForTesting.txt') delete ].

I will try to fix it,

The initial problem was that monticello is trying to delete an
un-existing mcz file in the package-cache.
Strange that nobody else had this problem before.

Fernando


On Wed, Jul 4, 2012 at 9:32 AM, [hidden email]
<[hidden email]> wrote:

> Yes, i'm using the latest VM's from Jenkins.
>
> I've tried with both Cog and NB vm's.
>
> It appears to be related to the (internal) FilePlugin, did esteban
> make changes to it?
>
> Surely this happened to somebody else? When trying to load/merge/commit ?
>
> Fernando
>
>
> On Wed, Jul 4, 2012 at 9:28 AM, Marcus Denker <[hidden email]> wrote:
>> Are you using a current VM from Jenkins?
>>
>> I think FileSystem needs some fixes in the Vm File plugin...
>>
>> On Jul 4, 2012, at 9:23 AM, Fernando Olivero wrote:
>>
>>> Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
>>> that prevents from using Gofer and monticello.
>>>
>>> Its related to the FileSystem primitives, when trying to delete a file.
>>>
>>> To reproduce evaluate the following code ( change 'PharoDebug.log' for
>>> any existing file in the same directory as the image).
>>>
>>> | path |
>>> path := FileSystem disk workingDirectory.
>>> p := FilePluginPrims new .
>>> p  deleteDirectory: (path / 'PharoDebug.log') fullName.
>>>
>>>
>>> Any idea why?
>>>
>>> Thanks,
>>> Fernando
>>>
>>
>> --
>> Marcus Denker -- http://marcusdenker.de
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Fernando olivero-2
In reply to this post by Fernando olivero-2
I wanted to provide the following fix to the previous problem: to
check wether a file exists before deleting it.

FileSystem>>delete: aResolvable
        aResolvable asFileReference exists ifTrue:[ store delete: (self
resolve: aResolvable) ]

But i found that the following is working incorrectly:

(FileSystem disk workingDirectory / 'unexistingFileForTesting.txt')
asFileReference exists = true


Esteban, maybe this is the cause of problems? Was it like this before?


Fernando


On Wed, Jul 4, 2012 at 9:42 AM, [hidden email]
<[hidden email]> wrote:

> Hi Sven, yes is working.
>
> I found the error. Try evaluating the code WHEN the file is un-existing.
>
> 2 timesRepeat:[ (FileSystem disk workingDirectory /
> 'unexistingFileForTesting.txt') delete ].
>
> I will try to fix it,
>
> The initial problem was that monticello is trying to delete an
> un-existing mcz file in the package-cache.
> Strange that nobody else had this problem before.
>
> Fernando
>
>
> On Wed, Jul 4, 2012 at 9:32 AM, [hidden email]
> <[hidden email]> wrote:
>> Yes, i'm using the latest VM's from Jenkins.
>>
>> I've tried with both Cog and NB vm's.
>>
>> It appears to be related to the (internal) FilePlugin, did esteban
>> make changes to it?
>>
>> Surely this happened to somebody else? When trying to load/merge/commit ?
>>
>> Fernando
>>
>>
>> On Wed, Jul 4, 2012 at 9:28 AM, Marcus Denker <[hidden email]> wrote:
>>> Are you using a current VM from Jenkins?
>>>
>>> I think FileSystem needs some fixes in the Vm File plugin...
>>>
>>> On Jul 4, 2012, at 9:23 AM, Fernando Olivero wrote:
>>>
>>>> Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
>>>> that prevents from using Gofer and monticello.
>>>>
>>>> Its related to the FileSystem primitives, when trying to delete a file.
>>>>
>>>> To reproduce evaluate the following code ( change 'PharoDebug.log' for
>>>> any existing file in the same directory as the image).
>>>>
>>>> | path |
>>>> path := FileSystem disk workingDirectory.
>>>> p := FilePluginPrims new .
>>>> p  deleteDirectory: (path / 'PharoDebug.log') fullName.
>>>>
>>>>
>>>> Any idea why?
>>>>
>>>> Thanks,
>>>> Fernando
>>>>
>>>
>>> --
>>> Marcus Denker -- http://marcusdenker.de
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

EstebanLM
yeah, that bug is around since some time (it was not my fault, he)... but I *thought* I fixed it... ok, I will re-check.
Maybe code was rollbacked for some weird reason.

Esteban

On Jul 4, 2012, at 9:51 AM, Fernando Olivero wrote:

> I wanted to provide the following fix to the previous problem: to
> check wether a file exists before deleting it.
>
> FileSystem>>delete: aResolvable
> aResolvable asFileReference exists ifTrue:[ store delete: (self
> resolve: aResolvable) ]
>
> But i found that the following is working incorrectly:
>
> (FileSystem disk workingDirectory / 'unexistingFileForTesting.txt')
> asFileReference exists = true
>
>
> Esteban, maybe this is the cause of problems? Was it like this before?
>
>
> Fernando
>
>
> On Wed, Jul 4, 2012 at 9:42 AM, [hidden email]
> <[hidden email]> wrote:
>> Hi Sven, yes is working.
>>
>> I found the error. Try evaluating the code WHEN the file is un-existing.
>>
>> 2 timesRepeat:[ (FileSystem disk workingDirectory /
>> 'unexistingFileForTesting.txt') delete ].
>>
>> I will try to fix it,
>>
>> The initial problem was that monticello is trying to delete an
>> un-existing mcz file in the package-cache.
>> Strange that nobody else had this problem before.
>>
>> Fernando
>>
>>
>> On Wed, Jul 4, 2012 at 9:32 AM, [hidden email]
>> <[hidden email]> wrote:
>>> Yes, i'm using the latest VM's from Jenkins.
>>>
>>> I've tried with both Cog and NB vm's.
>>>
>>> It appears to be related to the (internal) FilePlugin, did esteban
>>> make changes to it?
>>>
>>> Surely this happened to somebody else? When trying to load/merge/commit ?
>>>
>>> Fernando
>>>
>>>
>>> On Wed, Jul 4, 2012 at 9:28 AM, Marcus Denker <[hidden email]> wrote:
>>>> Are you using a current VM from Jenkins?
>>>>
>>>> I think FileSystem needs some fixes in the Vm File plugin...
>>>>
>>>> On Jul 4, 2012, at 9:23 AM, Fernando Olivero wrote:
>>>>
>>>>> Hi, i found an error in the latest Pharo2.0 build, at least in OSX ,
>>>>> that prevents from using Gofer and monticello.
>>>>>
>>>>> Its related to the FileSystem primitives, when trying to delete a file.
>>>>>
>>>>> To reproduce evaluate the following code ( change 'PharoDebug.log' for
>>>>> any existing file in the same directory as the image).
>>>>>
>>>>> | path |
>>>>> path := FileSystem disk workingDirectory.
>>>>> p := FilePluginPrims new .
>>>>> p  deleteDirectory: (path / 'PharoDebug.log') fullName.
>>>>>
>>>>>
>>>>> Any idea why?
>>>>>
>>>>> Thanks,
>>>>> Fernando
>>>>>
>>>>
>>>> --
>>>> Marcus Denker -- http://marcusdenker.de
>>>>
>>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Sven Van Caekenberghe
In reply to this post by Fernando olivero-2

On 04 Jul 2012, at 09:51, Fernando Olivero wrote:

> But i found that the following is working incorrectly:
>
> (FileSystem disk workingDirectory / 'unexistingFileForTesting.txt')
> asFileReference exists = true

Hmm, that would be a serious problem, I am using that as well,

        (FileSystem disk workingDirectory / 'unexistingFileForTesting.txt') exists

gives false for me ;-)

And this works as well:

        2 timesRepeat:[ (FileSystem disk workingDirectory /
                'unexistingFileForTesting.txt') delete ].

Is there a unit test covering your problem ?
If not, there should be.

Sven

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Fernando olivero-2
In reply to this post by Fernando olivero-2
Yes, i'm using the latest.

VM:  https://ci.lille.inria.fr/pharo/job/Cog-VM/Architecture=32,OS=mac/58/

Sven, are you using Mac OSX ?

Esteban replied that's a known bug, (unexisting file giving tue on
#exists) maybe its implied that'solely for the Mac ?

I will do an unit test to capture this issue.

Fernando


On Wed, Jul 4, 2012 at 10:44 AM, Sven Van Caekenberghe <[hidden email]> wrote:

>
> On 04 Jul 2012, at 09:51, Fernando Olivero wrote:
>
>> But i found that the following is working incorrectly:
>>
>> (FileSystem disk workingDirectory / 'unexistingFileForTesting.txt')
>> asFileReference exists = true
>
> Hmm, that would be a serious problem, I am using that as well,
>
>         (FileSystem disk workingDirectory / 'unexistingFileForTesting.txt') exists
>
> gives false for me ;-)
>
> And this works as well:
>
>         2 timesRepeat:[ (FileSystem disk workingDirectory /
>                 'unexistingFileForTesting.txt') delete ].
>
> Is there a unit test covering your problem ?
> If not, there should be.
>
> Sven

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

EstebanLM
It *was* a known bug... I'm also not being able to reproduce it :)

On Jul 4, 2012, at 10:53 AM, Fernando Olivero wrote:

> Yes, i'm using the latest.
>
> VM:  https://ci.lille.inria.fr/pharo/job/Cog-VM/Architecture=32,OS=mac/58/
>
> Sven, are you using Mac OSX ?
>
> Esteban replied that's a known bug, (unexisting file giving tue on
> #exists) maybe its implied that'solely for the Mac ?
>
> I will do an unit test to capture this issue.
>
> Fernando
>
>
> On Wed, Jul 4, 2012 at 10:44 AM, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>> On 04 Jul 2012, at 09:51, Fernando Olivero wrote:
>>
>>> But i found that the following is working incorrectly:
>>>
>>> (FileSystem disk workingDirectory / 'unexistingFileForTesting.txt')
>>> asFileReference exists = true
>>
>> Hmm, that would be a serious problem, I am using that as well,
>>
>>        (FileSystem disk workingDirectory / 'unexistingFileForTesting.txt') exists
>>
>> gives false for me ;-)
>>
>> And this works as well:
>>
>>        2 timesRepeat:[ (FileSystem disk workingDirectory /
>>                'unexistingFileForTesting.txt') delete ].
>>
>> Is there a unit test covering your problem ?
>> If not, there should be.
>>
>> Sven
>


Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Sven Van Caekenberghe
In reply to this post by Fernando olivero-2

On 04 Jul 2012, at 10:53, Fernando Olivero wrote:

> Sven, are you using Mac OSX ?

SystemVersion current

Pharo2.0a of '18 April 2012' update 20179

Smalltalk vm version

'CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012, StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun 22 2012, https://git.gitorious.org/cogvm/blessed.git Commit: 744bfe905c78a1a5d408680a8780367ea77e0549 Date: Fri Jun 1 15:17:41 2012 +0200 By: Esteban Lorenzano <[hidden email]>'

It is really strange that it does not work for you…


Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Sean P. DeNigris
Administrator
In reply to this post by Fernando olivero-2
Fernando olivero-2 wrote
FileSystem>>delete: aResolvable
        aResolvable asFileReference exists ifTrue:[ store delete: (self
resolve: aResolvable) ]
Now that we have #ensureDelete, #delete should signal an error for a non-existent file
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Camillo Bruni-3
In reply to this post by Fernando olivero-2
Fernando be sure to get rid of all the old vms on OSX :P
OSX is particularly good in finding an old version somewhere that does not properly work :P

On 2012-07-04, at 10:54, Fernando Olivero wrote:

> Yes, i'm using the latest.
>
> VM:  https://ci.lille.inria.fr/pharo/job/Cog-VM/Architecture=32,OS=mac/58/
>
> Sven, are you using Mac OSX ?
>
> Esteban replied that's a known bug, (unexisting file giving tue on
> #exists) maybe its implied that'solely for the Mac ?
>
> I will do an unit test to capture this issue.
>
> Fernando

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Fernando olivero-2
In reply to this post by Fernando olivero-2
ok, now is working just fine.  I've downloaded the latest CogVM, NB
VM, and Pharo2.0 from Jenkins.

Although i'm 100% sure i was using the downloaded vm's, i deleted the
old vm's in my machine also, as Camilo suggested. Couldnt figure out
why it wasnt working for me previously, but its fixed now!


Thanks for the help,

Fernando

On Wed, Jul 4, 2012 at 4:19 PM, Camillo Bruni <[hidden email]> wrote:

> Fernando be sure to get rid of all the old vms on OSX :P
> OSX is particularly good in finding an old version somewhere that does not properly work :P
>
> On 2012-07-04, at 10:54, Fernando Olivero wrote:
>
>> Yes, i'm using the latest.
>>
>> VM:  https://ci.lille.inria.fr/pharo/job/Cog-VM/Architecture=32,OS=mac/58/
>>
>> Sven, are you using Mac OSX ?
>>
>> Esteban replied that's a known bug, (unexisting file giving tue on
>> #exists) maybe its implied that'solely for the Mac ?
>>
>> I will do an unit test to capture this issue.
>>
>> Fernando

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileSystem primitives in latest Pharo2.0

Sean P. DeNigris
Administrator
Fernando olivero-2 wrote
i deleted the
old vm's in my machine also, as Camilo suggested. Couldnt figure out
why it wasnt working for me previously, but its fixed now!
OS X is *extremely* sneaky (cough buggy) in picking which VM to run when you double-click on an image.
Cheers,
Sean