Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-12 Thread Martin Dias
I think that then this deserves at least a page in the documentation, right? +1 I'll add something. -- Mariano http://marianopeck.wordpress.com

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-11 Thread Mariano Martinez Peck
I don't understand. Fuel holding multiple streams ? why? for what? e.g. for source code. Imagine storing Monticello packages in Fuel so that the source code is stored in the Fuel file and doesn't have to be written to the changes file. Instead, a more powerful SourceFilesArray (actually a

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-11 Thread Mariano Martinez Peck
On Sat, Feb 11, 2012 at 2:32 AM, Yanni Chiu ya...@rogers.com wrote: On 10/02/12 3:45 PM, Stéphane Ducasse wrote: this is a good idea. Hmmm. I think the .zip file approach is the correct/better approach to take to my metadata problem. This discussion did turn up a feature of Fuel that was

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Mariano Martinez Peck
On Fri, Feb 10, 2012 at 7:01 AM, Yanni Chiu ya...@rogers.com wrote: On 09/02/12 10:20 PM, Martin Dias wrote: Hi! We don't have unused fields, but there is no problem to add your own prefix: [...] Is this ok for you? It'll do the job. Here's what the file would have: yanni$ od -c

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Ben Coman
Mariano Martinez Peck wrote: On Fri, Feb 10, 2012 at 7:01 AM, Yanni Chiu ya...@rogers.com wrote: On 09/02/12 10:20 PM, Martin Dias wrote: Hi! We don't have unused fields, but there is no problem to add your own prefix: [...] Is this ok for you? It'll do the job. Here's

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Mariano Martinez Peck
All you need to do is to send it a stream. If the stream is already at a certain position, it doesn't matter it will start from that position. Say you have stream where you write something first and then you give it to Fuel to serialize. The stream would be at some position different than

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Igor Stasenko
On 10 February 2012 10:19, Mariano Martinez Peck marianop...@gmail.com wrote: All you need to do is to send it a stream. If the stream is already at a certain position, it doesn't matter it will start from that position. Say you have stream where you write something first and then you give

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Martin Dias
Maybe is too much overhead, but it is also possible to serialize an object that represents the metadata as a prefix: FileStream forceNewFileNamed: 'demoMetadata.fuel' do: [:aStream | aStream binary. metadata := Dictionary with: #meta - 5. content := 'stuff'. FLSerializer newDefault serialize:

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Igor Stasenko
On 10 February 2012 16:24, Martin Dias tinchod...@gmail.com wrote: Maybe is too much overhead, but it is also possible to serialize an object that represents the metadata as a prefix: FileStream forceNewFileNamed: 'demoMetadata.fuel' do: [:aStream | aStream binary. metadata := Dictionary

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Yanni Chiu
On 10/02/12 10:24 AM, Martin Dias wrote: Maybe is too much overhead, but it is also possible to serialize an object that represents the metadata as a prefix: FileStream forceNewFileNamed: 'demoMetadata.fuel' do: [:aStream | aStream binary. metadata := Dictionary with: #meta - 5. content :=

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Martin Dias
On Fri, Feb 10, 2012 at 2:45 PM, Yanni Chiu ya...@rogers.com wrote: On 10/02/12 10:24 AM, Martin Dias wrote: Maybe is too much overhead, but it is also possible to serialize an object that represents the metadata as a prefix: FileStream forceNewFileNamed: 'demoMetadata.fuel' do: [:aStream |

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Yanni Chiu
On 10/02/12 1:03 PM, Martin Dias wrote: Great. Maybe we should include #nextMaterializedRootFrom: to fuel. That would be great. Probably best to leave off #allMaterializedRootsFrom: - it seemed necessary for completeness, but I've no actual need for it. Based on metadata you might decide

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Eliot Miranda
On Fri, Feb 10, 2012 at 1:19 AM, Mariano Martinez Peck marianop...@gmail.com wrote: All you need to do is to send it a stream. If the stream is already at a certain position, it doesn't matter it will start from that position. Say you have stream where you write something first and then

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Igor Stasenko
On 10 February 2012 19:27, Eliot Miranda eliot.mira...@gmail.com wrote: But if you choose this route let me strongly suggest you use the zip file format.  Its very useful with Monticello mcz's to be able to pick them apart using unzip. yes but then it makes the whole thing completely

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Stéphane Ducasse
this is a good idea. On Feb 10, 2012, at 12:25 AM, Yanni Chiu wrote: I'd like to store some metadata in a Fuel serialized file. I'd like to be able to read that metadata, without de-serializing the file. So, if there were a fixed header at the start of the file, with some unused fields,

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Stéphane Ducasse
Great. Maybe we should include #nextMaterializedRootFrom: to fuel. And I would love a chapter for our book :) But after mariano finished his phd draft :)

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Norbert Hartl
Am 10.02.2012 um 19:51 schrieb Igor Stasenko: On 10 February 2012 19:27, Eliot Miranda eliot.mira...@gmail.com wrote: But if you choose this route let me strongly suggest you use the zip file format. Its very useful with Monticello mcz's to be able to pick them apart using unzip.

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Ben Coman
Norbert Hartl wrote: Am 10.02.2012 um 19:51 schrieb Igor Stasenko: On 10 February 2012 19:27, Eliot Miranda eliot.mira...@gmail.com wrote: But if you choose this route let me strongly suggest you use the zip file format. Its very useful with Monticello mcz's to be able to pick them

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-10 Thread Yanni Chiu
On 10/02/12 3:45 PM, Stéphane Ducasse wrote: this is a good idea. Hmmm. I think the .zip file approach is the correct/better approach to take to my metadata problem. This discussion did turn up a feature of Fuel that was not obvious to me before - namely, that you can read/write multiple

[Pharo-project] Is there an adhoc header field in Fuel?

2012-02-09 Thread Yanni Chiu
I'd like to store some metadata in a Fuel serialized file. I'd like to be able to read that metadata, without de-serializing the file. So, if there were a fixed header at the start of the file, with some unused fields, that would be ideal.

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-09 Thread Martin Dias
Hi! We don't have unused fields, but there is no problem to add your own prefix: FileStream newFileNamed: 'demoMetadata.fuel' do: [:aStream | aStream binary. aStream nextStringPut: 'metadata=5'. FLSerializer newDefault serialize: 'stuff' on: aStream ]. FileStream oldFileNamed:

Re: [Pharo-project] Is there an adhoc header field in Fuel?

2012-02-09 Thread Yanni Chiu
On 09/02/12 10:20 PM, Martin Dias wrote: Hi! We don't have unused fields, but there is no problem to add your own prefix: [...] Is this ok for you? It'll do the job. Here's what the file would have: yanni$ od -c demoMetadata.fuel 000 \n m e t a d a t a = 5 F U