Re: [Pharo-project] Bug in FileSystem

2012-01-09 Thread csrabak
But what if count makes handle pass over the end of the file? -- Cesar Rabak Em 07/01/2012 10:10, Mariano Martinez Peck < marianop...@gmail.com > escreveu: FSReadStream >> next: count | result | result := ByteArray new: count. handle at: position read: result startingAt: 1 count: count. pos

Re: [Pharo-project] Bug in FileSystem

2012-01-09 Thread Mariano Martinez Peck
So, here it is: http://code.google.com/p/pharo/issues/detail?id=5161 On Sun, Jan 8, 2012 at 2:39 PM, Mariano Martinez Peck wrote: > > >>> As for the API: >> >> 1) There's no next: into: (which returns the amount read). It's really >> the only way to do buffers without garbage allocations. >> >

Re: [Pharo-project] Bug in FileSystem

2012-01-08 Thread Mariano Martinez Peck
> >> As for the API: > > 1) There's no next: into: (which returns the amount read). It's really the > only way to do buffers without garbage allocations. > Hi Henry. One of the extensions I needed to add to FSReadStream in order to make it work with Fuel was exatly #next:into: The method is: nex

Re: [Pharo-project] Bug in FileSystem

2012-01-08 Thread Mariano Martinez Peck
On Sat, Jan 7, 2012 at 2:05 PM, Henrik Sperre Johansen < henrik.s.johan...@veloxit.no> wrote: > On 07.01.2012 13:20, Stéphane Ducasse wrote: > >> sounds like :) >> >> Stef >> >> On Jan 7, 2012, at 1:10 PM, Mariano Martinez Peck wrote: >> >> FSReadStream>> next: count >>> | result | >>> r

Re: [Pharo-project] Bug in FileSystem

2012-01-07 Thread Stéphane Ducasse
How can we build and improve FS? I'm too busy with other topics but I would love to get some momentum on that topic. Stef > On 07 Jan 2012, at 14:19, Henrik Sperre Johansen wrote: >> >>> 1) There's no next: into: (which returns the amount read). It's really the >>> only way to do buffers wi

Re: [Pharo-project] Bug in FileSystem

2012-01-07 Thread Nicolas Cellier
2012/1/7 Sven Van Caekenberghe : > > On 07 Jan 2012, at 14:19, Henrik Sperre Johansen wrote: > >> 1) There's no next: into: (which returns the amount read). It's really the >> only way to do buffers without garbage allocations. > > The 2 key methods for efficient IO are: > > readInto: collection s

Re: [Pharo-project] Bug in FileSystem

2012-01-07 Thread Sven Van Caekenberghe
On 07 Jan 2012, at 14:19, Henrik Sperre Johansen wrote: > 1) There's no next: into: (which returns the amount read). It's really the > only way to do buffers without garbage allocations. The 2 key methods for efficient IO are: readInto: collection startingAt: offset count: requestedCount

Re: [Pharo-project] Bug in FileSystem

2012-01-07 Thread Nicolas Cellier
2012/1/7 Henrik Sperre Johansen : > On 07.01.2012 14:05, Henrik Sperre Johansen wrote: >> >> On 07.01.2012 13:20, Stéphane Ducasse wrote: >>> >>> sounds like :) >>> >>> Stef >>> >>> On Jan 7, 2012, at 1:10 PM, Mariano Martinez Peck wrote: >>> FSReadStream>>  next: count     | result | >>>

Re: [Pharo-project] Bug in FileSystem

2012-01-07 Thread Henrik Sperre Johansen
On 07.01.2012 14:05, Henrik Sperre Johansen wrote: On 07.01.2012 13:20, Stéphane Ducasse wrote: sounds like :) Stef On Jan 7, 2012, at 1:10 PM, Mariano Martinez Peck wrote: FSReadStream>> next: count | result | result := ByteArray new: count. handle at: position read: result

Re: [Pharo-project] Bug in FileSystem

2012-01-07 Thread Henrik Sperre Johansen
On 07.01.2012 13:20, Stéphane Ducasse wrote: sounds like :) Stef On Jan 7, 2012, at 1:10 PM, Mariano Martinez Peck wrote: FSReadStream>> next: count | result | result := ByteArray new: count. handle at: position read: result startingAt: 1 count: count. position := positio

Re: [Pharo-project] Bug in FileSystem

2012-01-07 Thread Stéphane Ducasse
sounds like :) Stef On Jan 7, 2012, at 1:10 PM, Mariano Martinez Peck wrote: > FSReadStream >> next: count > | result | > result := ByteArray new: count. > handle at: position read: result startingAt: 1 count: count. > position := position + 1. > ^ result > > > shouldn't b

[Pharo-project] Bug in FileSystem

2012-01-07 Thread Mariano Martinez Peck
FSReadStream >> next: count | result | result := ByteArray new: count. handle at: position read: result startingAt: 1 count: count. position := position + 1. ^ result shouldn't be FSReadStream >> next: count | result | result := ByteArray new: count. handle at: p