yeah this is the annoying FSStream question... use FSReference >> #fileStreamWritable:do: for now...
On 2012-02-20, at 16:53, Stéphane Ducasse wrote: > camillo > > I'm trying your script with the latest image. > > > | f files| > f := FSFilesystem disk workingDirectory / 'www.squeaksource.com' / 'Kozen'. > files := f glob: [ :each| each basename endsWith: '.mcz']. > > files do: [ :file ||entity stream| > stream := file readStream. > (entity := ZnStreamingEntity type: ZnMimeType applicationOctetStream) > stream: stream; > contentLength: stream size. > Transcript show: file; cr. > "upload the version to gemstone" > ZnClient new > systemPolicy; > beOneShot; > signalProgress: true; > ifFail: [ :exception | Transcript show: file basename; show: ' > '; print: exception ]; > username: 'sd' password: 'sn00py_'; > entity: entity; > url: ( 'http://ss3.gemstone.com/ss/Kozen/', file basename); > put ] > displayingProgress: 'Uploading mcz' > > > apparently FSReadStream does not know isBinary > > > > streamFrom: inputStream to: outputStream size: totalSize > | bufferSize buffer leftToRead | > bufferSize := 4096 min: totalSize. > buffer := (inputStream isBinary ifTrue: [ ByteArray ] ifFalse: [ String > ]) new: bufferSize. > ^^^^^^^^^^ > leftToRead := totalSize. > [ leftToRead > 0 ] > whileTrue: [ | readCount | > readCount := bufferSize min: leftToRead. > inputStream next: readCount into: buffer. > leftToRead := leftToRead - readCount. > outputStream next: readCount putAll: buffer startingAt: > 1 ]
