Problem with FileHandle >> open [WAS] Re: FileReference should throw error when deleting unexisting files?

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

Problem with FileHandle >> open [WAS] Re: FileReference should throw error when deleting unexisting files?

Mariano Martinez Peck


On Tue, Jun 12, 2012 at 7:55 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi sean. It's time you update your image ;)
the tests in latest images:

works with
Pharo2.0a
Latest update: #20119

does not work with
Pharo2.0a
Latest update: #20129


problem is that (in the broken one) "reference openWritable: true" answers a handler with a NIL id....

will try to debug later. but if someone already have a hint...


So I have found the problem.

In the broken imagen:

FileHandle >> open
    self flag: 'TODO: for now we solely rely on the old FileStreams'
    "id := self basicOpen.
    id ifNil:     [
        reference exists ifFalse: [FileDoesNotExist signalWith: reference].
        self error: 'Unable to open file ' , reference printString]"

so of course the id remains in nil when it shouldn't. And the image where it works the code is not commened. If I uncomment the code of course it works.
So what was the idea beheind this change?
camillo?

 
cheers



On Tue, Jun 12, 2012 at 7:04 PM, Mariano Martinez Peck <[hidden email]> wrote:


On Tue, Jun 12, 2012 at 6:27 PM, Mariano Martinez Peck <[hidden email]> wrote:


On Tue, Jun 12, 2012 at 6:07 PM, Sean P. DeNigris <[hidden email]> wrote:

Mariano Martinez Peck wrote
>
> really??? i have just tried with that VM and I still get a false. Can you
> try with a different name instead of 'plonk' ??? like 'dasdasdasdasdasd' ?
> :)

that worked too... I'm attaching
http://forum.world.st/file/n4634490/CogVM.zip the vm on Nabble . Just to be
clear, you're highlighting the whole block and doing "PrintIt", right?

yes, I do that. 
Tried with that VM, same result.
Just to clarify, the output of Smalltalk vm version is


Smalltalk vm version 'CoInterpreter VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012, StackToRegisterMappingCogit VMMaker-oscog-EstebanLorenzano.160 uuid: bec8cdf0-4e06-4975-8c02-e882fadf4df3 Jun  1 2012, https://git.gitorious.org/cogvm/blessed.git Commit: 2b16c2cfc16ef2e08dbc93113ce9552e810e3e78 Date: Wed May <a href="tel:30%2016" value="+333016" target="_blank">30 16:16:27 2012 +0200 By: Esteban Lorenzano <[hidden email]>'

maybe this is because I am in snow leopard and you are in lion?


let's see something else. If you run all FileSystem tests, how many yellow do you have? I have 4, one looking suspicious ;)

312 run, 308 passes, 0 expected failures, 4 failures, 0 errors, 0 unexpected passes
Failures:
DiskFileSystemTest>>#testCopyDestExists
DiskFileSystemTest>>#testFile
DiskFileSystemTest>>#testRootIsNotAFile
FileHandleTest>>#testCreatedOpen

Errors:


#testCreatedOpen  is failing...maybe this is related....


 

--
Mariano
http://marianopeck.wordpress.com




--
Mariano
http://marianopeck.wordpress.com




--
Mariano
http://marianopeck.wordpress.com




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileHandle >> open [WAS] Re: FileReference should throw error when deleting unexisting files?

Stéphane Ducasse
Camillo

> So what was the idea beheind this change?
> camillo?
>

Yes

We should stabilize his cool effort to use FS and there were some bug in the FIlePlugin just to make things more complex


Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileHandle >> open [WAS] Re: FileReference should throw error when deleting unexisting files?

Camillo Bruni-3
In reply to this post by Mariano Martinez Peck

> In the broken imagen:
>
> FileHandle >> open
>     self flag: 'TODO: for now we solely rely on the old FileStreams'
>     "id := self basicOpen.
>     id ifNil:     [
>         reference exists ifFalse: [FileDoesNotExist signalWith: reference].
>         self error: 'Unable to open file ' , reference printString]"
>
> so of course the id remains in nil when it shouldn't. And the image where it works the code is not commened. If I uncomment the code of course it works.
> So what was the idea beheind this change?
> camillo?

because you'll open the file twice!

once in the FileHandle (which is never going to be used) and then again in the FileStream!

of course the way to go would be to fully rely on FileHandles,
but then somebody (hint hint) has to implement a full FileStream protocol
on top of the FileHandles ;)

In the future we will do this since it nicely separates the stream source
(based on bytes) from the actually streamed data (mostly characters).

but for now this is additional work :/

AFAIK I had all the tests running in my image, so what's the problem
again here? (I missed the whole discussion earlier :P)

cami
Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileHandle >> open [WAS] Re: FileReference should throw error when deleting unexisting files?

Mariano Martinez Peck


On Tue, Jun 12, 2012 at 10:49 PM, Camillo Bruni <[hidden email]> wrote:

> In the broken imagen:
>
> FileHandle >> open
>     self flag: 'TODO: for now we solely rely on the old FileStreams'
>     "id := self basicOpen.
>     id ifNil:     [
>         reference exists ifFalse: [FileDoesNotExist signalWith: reference].
>         self error: 'Unable to open file ' , reference printString]"
>
> so of course the id remains in nil when it shouldn't. And the image where it works the code is not commened. If I uncomment the code of course it works.
> So what was the idea beheind this change?
> camillo?

because you'll open the file twice!

once in the FileHandle (which is never going to be used) and then again in the FileStream!

of course the way to go would be to fully rely on FileHandles,
but then somebody (hint hint) has to implement a full FileStream protocol
on top of the FileHandles ;)

In the future we will do this since it nicely separates the stream source
(based on bytes) from the actually streamed data (mostly characters).

but for now this is additional work :/

AFAIK I had all the tests running in my image, so what's the problem
again here? (I missed the whole discussion earlier :P)


Update to the last image 20129 there are 4 failing tests and I come to this conclusion.

--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileHandle >> open [WAS] Re: FileReference should throw error when deleting unexisting files?

Camillo Bruni-3

> Update to the last image 20129 there are 4 failing tests and I come to this conclusion.

ok but these are whitebox tests which have to be adapted... (apparently my changes got lost there)

FileSystem-Tests-Core-CamilloBruni.9

in PharoInbox fixes this :) (by changing the tests)



Reply | Threaded
Open this post in threaded view
|

Re: Problem with FileHandle >> open [WAS] Re: FileReference should throw error when deleting unexisting files?

Mariano Martinez Peck


On Tue, Jun 12, 2012 at 11:55 PM, Camillo Bruni <[hidden email]> wrote:

> Update to the last image 20129 there are 4 failing tests and I come to this conclusion.

ok but these are whitebox tests which have to be adapted... (apparently my changes got lost there)

FileSystem-Tests-Core-CamilloBruni.9

in PharoInbox fixes this :) (by changing the tests)





--
Mariano
http://marianopeck.wordpress.com