[Pkg] The Trunk: Compression-cmm.48.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Sep 1 20:44:10 UTC 2015


Chris Muller uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-cmm.48.mcz

==================== Summary ====================

Name: Compression-cmm.48
Author: cmm
Time: 1 September 2015, 3:43:17.149 pm
UUID: 833287cb-44f0-42e8-9419-bd8cde39dd0a
Ancestors: Compression-dtl.47

Allow zipping of directories with thousands of files, without creating thousands of instances of simultaneously open FileStream's in the image.

=============== Diff against Compression-dtl.47 ===============

Item was added:
+ ----- Method: ZipArchiveMember>>openStreamWhile: (in category 'private-writing') -----
+ openStreamWhile: aBlock
+ 	^ aBlock value!

Item was changed:
  ----- Method: ZipArchiveMember>>writeTo: (in category 'writing') -----
+ writeTo: aStream 
+ 	self openStreamWhile:
+ 		[ self rewindData.
+ 		writeLocalHeaderRelativeOffset := aStream position.
+ 		self
+ 			 writeLocalFileHeaderTo: aStream ;
+ 			 writeDataTo: aStream ;
+ 			 refreshLocalFileHeaderTo: aStream ]!
- writeTo: aStream
- 	self rewindData.
- 	writeLocalHeaderRelativeOffset := aStream position.
- 	self writeLocalFileHeaderTo: aStream.
- 	self writeDataTo: aStream.
- 	self refreshLocalFileHeaderTo: aStream.!

Item was changed:
  ----- Method: ZipNewFileMember>>from: (in category 'initialization') -----
  from: aFileName
  	| entry |
  	compressionMethod := CompressionStored.
  	"Now get the size, attributes, and timestamps, and see if the file exists"
  	stream := StandardFileStream readOnlyFileNamed: aFileName.
  	self localFileName: (externalFileName := stream name).
  	entry := stream directoryEntry.
  	compressedSize := uncompressedSize := entry fileSize.
  	desiredCompressionMethod := compressedSize > 0 ifTrue: [ CompressionDeflated ] ifFalse: [ CompressionStored ].
+ 	self setLastModFileDateTimeFrom: entry modificationTime.
+ 	stream close!
- 	self setLastModFileDateTimeFrom: entry modificationTime
- !

Item was added:
+ ----- Method: ZipNewFileMember>>openStreamWhile: (in category 'private-writing') -----
+ openStreamWhile: aBlock 
+ 	stream open.
+ 	^ aBlock ensure: [ stream close ]!



More information about the Packages mailing list