SIXX can't read from sixx file.

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

SIXX can't read from sixx file.

Paul DeBruicker
Hi -

In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading
Grease Core version 1.0.2,  XMLSupport version 1.0.5, and
SIXX-NorbertHartl.173  there are a series of errors when running

SixxExamples example5
SixxExamples example6

It seems that example5 works perfectly and example6 has problems because
there is no FileDirectory classSide>>readOnlyFileNamed:

One fix is to change the SixxPortableUtil classSide>>
readFileStreamNamed: method to:

readFileStreamNamed: aFilename
     "#Squeak Specific#"
     ^(FileDirectory new readOnlyFileNamed: aFilename) contents.

and change SixxExamples example6 to:

example6
     "SixxExamples example6"
     "Read object data from an external file"

     | srs objects |
     srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
     objects := OrderedCollection new.
     [srs atEnd] whileFalse: [objects add: srs next].
"    srs close."
     objects inspect.

But that probably creates other problems and isn't an ideal solution.

Also I create a ConfigurationOfSixx that just works for Gemstone right
now. Where should I put it?

Thanks

Paul
Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Paul DeBruicker
I forgot to mention that I also changed the isEmpty call to isEmptyOrNil
in  FileDirectory>>fullNameFor: so it now looks like this:

fullNameFor: fileName
     "Return a corrected, fully-qualified name for the given file name.
If the given name is already a full path (i.e., it contains a delimiter
character), assume it is already a fully-qualified name. Otherwise,
prefix it with the path to this directory. In either case, correct the
local part of the file name."
     "Details: Note that path relative to a directory, such as
'../../foo' are disallowed by this algorithm.  Also note that this
method is tolerent of a nil argument -- is simply returns nil in this case."

     | correctedLocalName prefix |
     fileName ifNil: [^ nil].
     self class splitName: fileName to:
         [:filePath :localName |
             correctedLocalName := localName.
             prefix := self fullPathFor: filePath].
     prefix isEmptyOrNil
         ifTrue: [^correctedLocalName].
     prefix last = self pathNameDelimiter
         ifTrue:[^ prefix, correctedLocalName]
         ifFalse:[^ prefix, self slash, correctedLocalName]

Which is also probably not a good solution but fixed it for the time
being and my specific use case.



On 12/02/2010 11:21 AM, Paul DeBruicker wrote:

> Hi -
>
> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading
> Grease Core version 1.0.2,  XMLSupport version 1.0.5, and
> SIXX-NorbertHartl.173  there are a series of errors when running
>
> SixxExamples example5
> SixxExamples example6
>
> It seems that example5 works perfectly and example6 has problems
> because there is no FileDirectory classSide>>readOnlyFileNamed:
>
> One fix is to change the SixxPortableUtil classSide>>
> readFileStreamNamed: method to:
>
> readFileStreamNamed: aFilename
>     "#Squeak Specific#"
>     ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>
> and change SixxExamples example6 to:
>
> example6
>     "SixxExamples example6"
>     "Read object data from an external file"
>
>     | srs objects |
>     srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>     objects := OrderedCollection new.
>     [srs atEnd] whileFalse: [objects add: srs next].
> "    srs close."
>     objects inspect.
>
> But that probably creates other problems and isn't an ideal solution.
>
> Also I create a ConfigurationOfSixx that just works for Gemstone right
> now. Where should I put it?
>
> Thanks
>
> Paul

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

NorbertHartl
In reply to this post by Paul DeBruicker
Hi Paul,

I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.

Norbert

On 02.12.2010, at 17:21, Paul DeBruicker wrote:

> Hi -
>
> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>
> SixxExamples example5
> SixxExamples example6
>
> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>
> One fix is to change the SixxPortableUtil classSide>> readFileStreamNamed: method to:
>
> readFileStreamNamed: aFilename
>    "#Squeak Specific#"
>    ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>
> and change SixxExamples example6 to:
>
> example6
>    "SixxExamples example6"
>    "Read object data from an external file"
>
>    | srs objects |
>    srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>    objects := OrderedCollection new.
>    [srs atEnd] whileFalse: [objects add: srs next].
> "    srs close."
>    objects inspect.
>
> But that probably creates other problems and isn't an ideal solution.
>
> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>
> Thanks
>
> Paul

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Paul DeBruicker
Hi Norbert,

Thanks for the pointer.  In a workspace if I inspect:

Object readSixxFrom: (SixxReadStream readOnlyFileNamed:('obj.sixx'))


I get the same problems I described.  In Gemstone what is the
appropriate way to read a SIXX file into a stream?


Paul



On 12/02/2010 11:32 AM, Norbert Hartl wrote:

> Hi Paul,
>
> I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
> In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.
>
> Norbert
>
> On 02.12.2010, at 17:21, Paul DeBruicker wrote:
>
>> Hi -
>>
>> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>>
>> SixxExamples example5
>> SixxExamples example6
>>
>> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>>
>> One fix is to change the SixxPortableUtil classSide>>  readFileStreamNamed: method to:
>>
>> readFileStreamNamed: aFilename
>>     "#Squeak Specific#"
>>     ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>>
>> and change SixxExamples example6 to:
>>
>> example6
>>     "SixxExamples example6"
>>     "Read object data from an external file"
>>
>>     | srs objects |
>>     srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>>     objects := OrderedCollection new.
>>     [srs atEnd] whileFalse: [objects add: srs next].
>> "    srs close."
>>     objects inspect.
>>
>> But that probably creates other problems and isn't an ideal solution.
>>
>> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>>
>> Thanks
>>
>> Paul

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Dale Henrichs
Paul,

I plan to look at this in the next week or so (Issue 202), but until
then look at the class BinaryOrTextFile which should wrap files with
stream-like behavior (see FileDirectory>>readoOnlyFileNamed: for an
example)....

Dale

On 12/02/2010 10:34 AM, Paul DeBruicker wrote:

> Hi Norbert,
>
> Thanks for the pointer.  In a workspace if I inspect:
>
> Object readSixxFrom: (SixxReadStream readOnlyFileNamed:('obj.sixx'))
>
>
> I get the same problems I described.  In Gemstone what is the
> appropriate way to read a SIXX file into a stream?
>
>
> Paul
>
>
>
> On 12/02/2010 11:32 AM, Norbert Hartl wrote:
>> Hi Paul,
>>
>> I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
>> In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.
>>
>> Norbert
>>
>> On 02.12.2010, at 17:21, Paul DeBruicker wrote:
>>
>>> Hi -
>>>
>>> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>>>
>>> SixxExamples example5
>>> SixxExamples example6
>>>
>>> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>>>
>>> One fix is to change the SixxPortableUtil classSide>>   readFileStreamNamed: method to:
>>>
>>> readFileStreamNamed: aFilename
>>>      "#Squeak Specific#"
>>>      ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>>>
>>> and change SixxExamples example6 to:
>>>
>>> example6
>>>      "SixxExamples example6"
>>>      "Read object data from an external file"
>>>
>>>      | srs objects |
>>>      srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>>>      objects := OrderedCollection new.
>>>      [srs atEnd] whileFalse: [objects add: srs next].
>>> "    srs close."
>>>      objects inspect.
>>>
>>> But that probably creates other problems and isn't an ideal solution.
>>>
>>> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>>>
>>> Thanks
>>>
>>> Paul
>

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Johan Brichau-2
I have some different sixx problems.

First, I just tried the examples and they seem to work just fine if you adapt the following method to return false instead of true:

FileDirectory class>>onClient
        ^ false

Although that's probably not a fix to the actual problem, it does make the examples work and puts the files in de $GEMSTONE/seaside/data directory.

Next, I tried loading a sixx file that I exported from Pharo. The result: GemStone simply slams the session door at me when it tries getting the contents of the file.
The file loads fine in Pharo and it's 27 Mb.

Any ideas?


On 03 Dec 2010, at 00:58, Dale Henrichs wrote:

> Paul,
>
> I plan to look at this in the next week or so (Issue 202), but until then look at the class BinaryOrTextFile which should wrap files with stream-like behavior (see FileDirectory>>readoOnlyFileNamed: for an example)....
>
> Dale
>
> On 12/02/2010 10:34 AM, Paul DeBruicker wrote:
>> Hi Norbert,
>>
>> Thanks for the pointer.  In a workspace if I inspect:
>>
>> Object readSixxFrom: (SixxReadStream readOnlyFileNamed:('obj.sixx'))
>>
>>
>> I get the same problems I described.  In Gemstone what is the
>> appropriate way to read a SIXX file into a stream?
>>
>>
>> Paul
>>
>>
>>
>> On 12/02/2010 11:32 AM, Norbert Hartl wrote:
>>> Hi Paul,
>>>
>>> I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
>>> In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.
>>>
>>> Norbert
>>>
>>> On 02.12.2010, at 17:21, Paul DeBruicker wrote:
>>>
>>>> Hi -
>>>>
>>>> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>>>>
>>>> SixxExamples example5
>>>> SixxExamples example6
>>>>
>>>> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>>>>
>>>> One fix is to change the SixxPortableUtil classSide>>   readFileStreamNamed: method to:
>>>>
>>>> readFileStreamNamed: aFilename
>>>>     "#Squeak Specific#"
>>>>     ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>>>>
>>>> and change SixxExamples example6 to:
>>>>
>>>> example6
>>>>     "SixxExamples example6"
>>>>     "Read object data from an external file"
>>>>
>>>>     | srs objects |
>>>>     srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>>>>     objects := OrderedCollection new.
>>>>     [srs atEnd] whileFalse: [objects add: srs next].
>>>> "    srs close."
>>>>     objects inspect.
>>>>
>>>> But that probably creates other problems and isn't an ideal solution.
>>>>
>>>> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>>>>
>>>> Thanks
>>>>
>>>> Paul
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Dale Henrichs
Johan,

Client vs Server for FileDirectory is a persistent problem ... I've
written the Grease supporting code to always use
ServerFileDirectory...so instead of changing FileDirectory, use
ServerFileDirectory...

The basic problem extends from the fact that when running as a http
server, ServerFileDirectory should be used if only for performance reasons.

However, when running from a remote GemTools client, you _sometimes_
want to use the client version of FileDirectory, but that depends upon
what you are trying to do ....

Part of my work for porting Monticello to the GemStone 3.0 base was to
port Colin's Filesystem code to GemStone/S ... that's the good news. The
bad news was that I had to slash the heck out of the Pharo/Squeak
version, because Filesystem was not written to be very portable ...

The nice thing about Filesystem is that you can have a little more
control over whether you want the client or server at a 'path' level
rather than the class level.

The bad thing is that 105% of the code has FileDirectory wired into it
to resolve paths and the two different implementations don't mesh well
together ...

I guess I could add the class ClientFileDirectory and then make the
class FileDirectory to be configurable (whether you want onClient to be
true or not) ... this gives a bit control to you guys, but that doesn't
necessarily solve the problem ..

I'm open to more ideas and discussion on this...

Dale

On 12/06/2010 11:45 AM, Johan Brichau wrote:

> I have some different sixx problems.
>
> First, I just tried the examples and they seem to work just fine if you adapt the following method to return false instead of true:
>
> FileDirectory class>>onClient
> ^ false
>
> Although that's probably not a fix to the actual problem, it does make the examples work and puts the files in de $GEMSTONE/seaside/data directory.
>
> Next, I tried loading a sixx file that I exported from Pharo. The result: GemStone simply slams the session door at me when it tries getting the contents of the file.
> The file loads fine in Pharo and it's 27 Mb.
>
> Any ideas?
>
>
> On 03 Dec 2010, at 00:58, Dale Henrichs wrote:
>
>> Paul,
>>
>> I plan to look at this in the next week or so (Issue 202), but until then look at the class BinaryOrTextFile which should wrap files with stream-like behavior (see FileDirectory>>readoOnlyFileNamed: for an example)....
>>
>> Dale
>>
>> On 12/02/2010 10:34 AM, Paul DeBruicker wrote:
>>> Hi Norbert,
>>>
>>> Thanks for the pointer.  In a workspace if I inspect:
>>>
>>> Object readSixxFrom: (SixxReadStream readOnlyFileNamed:('obj.sixx'))
>>>
>>>
>>> I get the same problems I described.  In Gemstone what is the
>>> appropriate way to read a SIXX file into a stream?
>>>
>>>
>>> Paul
>>>
>>>
>>>
>>> On 12/02/2010 11:32 AM, Norbert Hartl wrote:
>>>> Hi Paul,
>>>>
>>>> I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
>>>> In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.
>>>>
>>>> Norbert
>>>>
>>>> On 02.12.2010, at 17:21, Paul DeBruicker wrote:
>>>>
>>>>> Hi -
>>>>>
>>>>> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>>>>>
>>>>> SixxExamples example5
>>>>> SixxExamples example6
>>>>>
>>>>> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>>>>>
>>>>> One fix is to change the SixxPortableUtil classSide>>    readFileStreamNamed: method to:
>>>>>
>>>>> readFileStreamNamed: aFilename
>>>>>      "#Squeak Specific#"
>>>>>      ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>>>>>
>>>>> and change SixxExamples example6 to:
>>>>>
>>>>> example6
>>>>>      "SixxExamples example6"
>>>>>      "Read object data from an external file"
>>>>>
>>>>>      | srs objects |
>>>>>      srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>>>>>      objects := OrderedCollection new.
>>>>>      [srs atEnd] whileFalse: [objects add: srs next].
>>>>> "    srs close."
>>>>>      objects inspect.
>>>>>
>>>>> But that probably creates other problems and isn't an ideal solution.
>>>>>
>>>>> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Paul
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Dale Henrichs
In reply to this post by Johan Brichau-2
Ah,

To address your specific issue...in Grease1.0.2.1 (not yet released),
I've changed the Grease support code to use ServerFileDirectory... so
that SIXX would work, so I am in the process of addressing the specific
problem related to SIXX...

Dale

On 12/06/2010 11:45 AM, Johan Brichau wrote:

> I have some different sixx problems.
>
> First, I just tried the examples and they seem to work just fine if you adapt the following method to return false instead of true:
>
> FileDirectory class>>onClient
> ^ false
>
> Although that's probably not a fix to the actual problem, it does make the examples work and puts the files in de $GEMSTONE/seaside/data directory.
>
> Next, I tried loading a sixx file that I exported from Pharo. The result: GemStone simply slams the session door at me when it tries getting the contents of the file.
> The file loads fine in Pharo and it's 27 Mb.
>
> Any ideas?
>
>
> On 03 Dec 2010, at 00:58, Dale Henrichs wrote:
>
>> Paul,
>>
>> I plan to look at this in the next week or so (Issue 202), but until then look at the class BinaryOrTextFile which should wrap files with stream-like behavior (see FileDirectory>>readoOnlyFileNamed: for an example)....
>>
>> Dale
>>
>> On 12/02/2010 10:34 AM, Paul DeBruicker wrote:
>>> Hi Norbert,
>>>
>>> Thanks for the pointer.  In a workspace if I inspect:
>>>
>>> Object readSixxFrom: (SixxReadStream readOnlyFileNamed:('obj.sixx'))
>>>
>>>
>>> I get the same problems I described.  In Gemstone what is the
>>> appropriate way to read a SIXX file into a stream?
>>>
>>>
>>> Paul
>>>
>>>
>>>
>>> On 12/02/2010 11:32 AM, Norbert Hartl wrote:
>>>> Hi Paul,
>>>>
>>>> I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
>>>> In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.
>>>>
>>>> Norbert
>>>>
>>>> On 02.12.2010, at 17:21, Paul DeBruicker wrote:
>>>>
>>>>> Hi -
>>>>>
>>>>> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>>>>>
>>>>> SixxExamples example5
>>>>> SixxExamples example6
>>>>>
>>>>> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>>>>>
>>>>> One fix is to change the SixxPortableUtil classSide>>    readFileStreamNamed: method to:
>>>>>
>>>>> readFileStreamNamed: aFilename
>>>>>      "#Squeak Specific#"
>>>>>      ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>>>>>
>>>>> and change SixxExamples example6 to:
>>>>>
>>>>> example6
>>>>>      "SixxExamples example6"
>>>>>      "Read object data from an external file"
>>>>>
>>>>>      | srs objects |
>>>>>      srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>>>>>      objects := OrderedCollection new.
>>>>>      [srs atEnd] whileFalse: [objects add: srs next].
>>>>> "    srs close."
>>>>>      objects inspect.
>>>>>
>>>>> But that probably creates other problems and isn't an ideal solution.
>>>>>
>>>>> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Paul
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Johan Brichau-2
In reply to this post by Dale Henrichs
Hi Dale,

Ok, I will adapt the Sixx code to use ServerFileDirectory. There's a specific class for the platform-specific parts it seems, where that can be done.
At least that means it will be working out-of-the-box for now.

Also, I just noticed that the behavior of BinaryOrTextFile>>contents is to grab the entire file and put it into a String, for which GemStone (tries) to reserve memory.
At that point, the session gets closed, probably because my file is too large.

I'm now *trying* to make Sixx work with BinaryOrTextFile itself, since that class supports the stream protocol anyway.
But it doesn't seem to play nicely either.

On 06 Dec 2010, at 21:11, Dale Henrichs wrote:

> Johan,
>
> Client vs Server for FileDirectory is a persistent problem ... I've written the Grease supporting code to always use ServerFileDirectory...so instead of changing FileDirectory, use ServerFileDirectory...
>
> The basic problem extends from the fact that when running as a http server, ServerFileDirectory should be used if only for performance reasons.
>
> However, when running from a remote GemTools client, you _sometimes_ want to use the client version of FileDirectory, but that depends upon what you are trying to do ....
>
> Part of my work for porting Monticello to the GemStone 3.0 base was to port Colin's Filesystem code to GemStone/S ... that's the good news. The bad news was that I had to slash the heck out of the Pharo/Squeak version, because Filesystem was not written to be very portable ...
>
> The nice thing about Filesystem is that you can have a little more control over whether you want the client or server at a 'path' level rather than the class level.
>
> The bad thing is that 105% of the code has FileDirectory wired into it to resolve paths and the two different implementations don't mesh well together ...
>
> I guess I could add the class ClientFileDirectory and then make the class FileDirectory to be configurable (whether you want onClient to be true or not) ... this gives a bit control to you guys, but that doesn't necessarily solve the problem ..
>
> I'm open to more ideas and discussion on this...
>
> Dale
>
> On 12/06/2010 11:45 AM, Johan Brichau wrote:
>> I have some different sixx problems.
>>
>> First, I just tried the examples and they seem to work just fine if you adapt the following method to return false instead of true:
>>
>> FileDirectory class>>onClient
>> ^ false
>>
>> Although that's probably not a fix to the actual problem, it does make the examples work and puts the files in de $GEMSTONE/seaside/data directory.
>>
>> Next, I tried loading a sixx file that I exported from Pharo. The result: GemStone simply slams the session door at me when it tries getting the contents of the file.
>> The file loads fine in Pharo and it's 27 Mb.
>>
>> Any ideas?
>>
>>
>> On 03 Dec 2010, at 00:58, Dale Henrichs wrote:
>>
>>> Paul,
>>>
>>> I plan to look at this in the next week or so (Issue 202), but until then look at the class BinaryOrTextFile which should wrap files with stream-like behavior (see FileDirectory>>readoOnlyFileNamed: for an example)....
>>>
>>> Dale
>>>
>>> On 12/02/2010 10:34 AM, Paul DeBruicker wrote:
>>>> Hi Norbert,
>>>>
>>>> Thanks for the pointer.  In a workspace if I inspect:
>>>>
>>>> Object readSixxFrom: (SixxReadStream readOnlyFileNamed:('obj.sixx'))
>>>>
>>>>
>>>> I get the same problems I described.  In Gemstone what is the
>>>> appropriate way to read a SIXX file into a stream?
>>>>
>>>>
>>>> Paul
>>>>
>>>>
>>>>
>>>> On 12/02/2010 11:32 AM, Norbert Hartl wrote:
>>>>> Hi Paul,
>>>>>
>>>>> I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
>>>>> In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.
>>>>>
>>>>> Norbert
>>>>>
>>>>> On 02.12.2010, at 17:21, Paul DeBruicker wrote:
>>>>>
>>>>>> Hi -
>>>>>>
>>>>>> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>>>>>>
>>>>>> SixxExamples example5
>>>>>> SixxExamples example6
>>>>>>
>>>>>> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>>>>>>
>>>>>> One fix is to change the SixxPortableUtil classSide>>    readFileStreamNamed: method to:
>>>>>>
>>>>>> readFileStreamNamed: aFilename
>>>>>>     "#Squeak Specific#"
>>>>>>     ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>>>>>>
>>>>>> and change SixxExamples example6 to:
>>>>>>
>>>>>> example6
>>>>>>     "SixxExamples example6"
>>>>>>     "Read object data from an external file"
>>>>>>
>>>>>>     | srs objects |
>>>>>>     srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>>>>>>     objects := OrderedCollection new.
>>>>>>     [srs atEnd] whileFalse: [objects add: srs next].
>>>>>> "    srs close."
>>>>>>     objects inspect.
>>>>>>
>>>>>> But that probably creates other problems and isn't an ideal solution.
>>>>>>
>>>>>> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Paul
>>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: SIXX can't read from sixx file.

Dale Henrichs
Johan,

Yes using BinaryOrTextfile was the first thing I tried with SIXX ... I
think what happens is that somewhere in the SIXX code the stream is
being reset in a way that doesn't notify the underlying GsFile about
what's happening ... but I didn't track it down ...

You might want to look at the XMLPullParser work that Ken Treis did:

   http://kentreis.wordpress.com/2009/06/01/deep-sixx-with-xml-pull-parser/

since he was working around the issues with loading giant SIXX files
into GemStone...

Dale

12/06/2010 12:35 PM, Johan Brichau wrote:

> Hi Dale,
>
> Ok, I will adapt the Sixx code to use ServerFileDirectory. There's a specific class for the platform-specific parts it seems, where that can be done.
> At least that means it will be working out-of-the-box for now.
>
> Also, I just noticed that the behavior of BinaryOrTextFile>>contents is to grab the entire file and put it into a String, for which GemStone (tries) to reserve memory.
> At that point, the session gets closed, probably because my file is too large.
>
> I'm now *trying* to make Sixx work with BinaryOrTextFile itself, since that class supports the stream protocol anyway.
> But it doesn't seem to play nicely either.
>
> On 06 Dec 2010, at 21:11, Dale Henrichs wrote:
>
>> Johan,
>>
>> Client vs Server for FileDirectory is a persistent problem ... I've written the Grease supporting code to always use ServerFileDirectory...so instead of changing FileDirectory, use ServerFileDirectory...
>>
>> The basic problem extends from the fact that when running as a http server, ServerFileDirectory should be used if only for performance reasons.
>>
>> However, when running from a remote GemTools client, you _sometimes_ want to use the client version of FileDirectory, but that depends upon what you are trying to do ....
>>
>> Part of my work for porting Monticello to the GemStone 3.0 base was to port Colin's Filesystem code to GemStone/S ... that's the good news. The bad news was that I had to slash the heck out of the Pharo/Squeak version, because Filesystem was not written to be very portable ...
>>
>> The nice thing about Filesystem is that you can have a little more control over whether you want the client or server at a 'path' level rather than the class level.
>>
>> The bad thing is that 105% of the code has FileDirectory wired into it to resolve paths and the two different implementations don't mesh well together ...
>>
>> I guess I could add the class ClientFileDirectory and then make the class FileDirectory to be configurable (whether you want onClient to be true or not) ... this gives a bit control to you guys, but that doesn't necessarily solve the problem ..
>>
>> I'm open to more ideas and discussion on this...
>>
>> Dale
>>
>> On 12/06/2010 11:45 AM, Johan Brichau wrote:
>>> I have some different sixx problems.
>>>
>>> First, I just tried the examples and they seem to work just fine if you adapt the following method to return false instead of true:
>>>
>>> FileDirectory class>>onClient
>>> ^ false
>>>
>>> Although that's probably not a fix to the actual problem, it does make the examples work and puts the files in de $GEMSTONE/seaside/data directory.
>>>
>>> Next, I tried loading a sixx file that I exported from Pharo. The result: GemStone simply slams the session door at me when it tries getting the contents of the file.
>>> The file loads fine in Pharo and it's 27 Mb.
>>>
>>> Any ideas?
>>>
>>>
>>> On 03 Dec 2010, at 00:58, Dale Henrichs wrote:
>>>
>>>> Paul,
>>>>
>>>> I plan to look at this in the next week or so (Issue 202), but until then look at the class BinaryOrTextFile which should wrap files with stream-like behavior (see FileDirectory>>readoOnlyFileNamed: for an example)....
>>>>
>>>> Dale
>>>>
>>>> On 12/02/2010 10:34 AM, Paul DeBruicker wrote:
>>>>> Hi Norbert,
>>>>>
>>>>> Thanks for the pointer.  In a workspace if I inspect:
>>>>>
>>>>> Object readSixxFrom: (SixxReadStream readOnlyFileNamed:('obj.sixx'))
>>>>>
>>>>>
>>>>> I get the same problems I described.  In Gemstone what is the
>>>>> appropriate way to read a SIXX file into a stream?
>>>>>
>>>>>
>>>>> Paul
>>>>>
>>>>>
>>>>>
>>>>> On 12/02/2010 11:32 AM, Norbert Hartl wrote:
>>>>>> Hi Paul,
>>>>>>
>>>>>> I don't have a Sixx installation handy right now. But have a look at Object>>readSixxFrom: there you can plug a stream and get back your object graph. I missed the examples methods completely. This should be fixed.
>>>>>> In the newer Sixx I changed the internal behaviour to decode from utf-8 automatically. So it is less a hussle to get all of the plumbing of stream types and encoding right.
>>>>>>
>>>>>> Norbert
>>>>>>
>>>>>> On 02.12.2010, at 17:21, Paul DeBruicker wrote:
>>>>>>
>>>>>>> Hi -
>>>>>>>
>>>>>>> In a new Gemstone 2.4.4.1 extent with Gemtools 1.0b4 and after loading Grease Core version 1.0.2,  XMLSupport version 1.0.5, and SIXX-NorbertHartl.173  there are a series of errors when running
>>>>>>>
>>>>>>> SixxExamples example5
>>>>>>> SixxExamples example6
>>>>>>>
>>>>>>> It seems that example5 works perfectly and example6 has problems because there is no FileDirectory classSide>>readOnlyFileNamed:
>>>>>>>
>>>>>>> One fix is to change the SixxPortableUtil classSide>>     readFileStreamNamed: method to:
>>>>>>>
>>>>>>> readFileStreamNamed: aFilename
>>>>>>>      "#Squeak Specific#"
>>>>>>>      ^(FileDirectory new readOnlyFileNamed: aFilename) contents.
>>>>>>>
>>>>>>> and change SixxExamples example6 to:
>>>>>>>
>>>>>>> example6
>>>>>>>      "SixxExamples example6"
>>>>>>>      "Read object data from an external file"
>>>>>>>
>>>>>>>      | srs objects |
>>>>>>>      srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
>>>>>>>      objects := OrderedCollection new.
>>>>>>>      [srs atEnd] whileFalse: [objects add: srs next].
>>>>>>> "    srs close."
>>>>>>>      objects inspect.
>>>>>>>
>>>>>>> But that probably creates other problems and isn't an ideal solution.
>>>>>>>
>>>>>>> Also I create a ConfigurationOfSixx that just works for Gemstone right now. Where should I put it?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Paul
>>>>>
>>>>
>>>
>>
>