[Pkg] Rio: File-Base-mtf.26.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Sat Apr 11 19:45:03 UTC 2009


A new version of File-Base was added to project Rio:
http://www.squeaksource.com/Rio/File-Base-mtf.26.mcz

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

Name: File-Base-mtf.26
Author: mtf
Time: 11 April 2009, 3:44:57 pm
UUID: 91ee8f2c-29c9-4f85-89f0-bf02ed469b86
Ancestors: File-Base-kph.25

- no more underscore assignments
- Use SharedQueue rather than SharedQueue2

=============== Diff against File-Base-kph.25 ===============

Item was changed:
  ----- Method: FileFtpExecutive>>copyUsing:from:to:relativeTo: (in category 'local/remote file copy') -----
  copyUsing: aSelector from: aDir to: someFD relativeTo: aBaseDir
  
  	"here we do two passes, first we ensure that all of the needed directories exist.
  	 for this we use our ususal ftp client.
  	
  	for the file transfers themselves we run n threads feeding from a shared queue
  	
  	"
  
  	| queue map done delay flg dest transfers |
  	
  	flg := FileNotification isOverwrite.
  
  	self ftpDo: [ :ftp |
  		map := self toDir: aDir mkpathAll: someFD relativeTo: aBaseDir.
  		
  		transfers := map select: [ :ea | 
  			dest := ea value.
  			dest isDirectory not and: [ flg or: [ dest exists not ] ]
  		]
  	].
  
  	delay := Delay forMilliseconds: 100.
+ 	queue := SharedQueue new setItems: transfers copy.
+ 	done :=  SharedQueue new.
- 	queue := SharedQueue2 new setItems: transfers copy.
- 	done :=  SharedQueue2 new.
  	
   	
  	self class prefFtpParallel timesRepeat: [
  			[
  				[ queue isEmpty ] whileFalse: [ 
  					queue nextOrNil ifNotNilDo: [ :ea | 
  						[ self perform: aSelector with: ea key with: ea value ] ensure: [ done nextPut: ea ].
  					]
  				]
  			] fork.
  		].
  	
  	[ done size < transfers size ] whileTrue: [ delay wait ]. 
   
  	"return all the destinations"
  	^ map collect: [ :ea | ea value ]
   !

Item was added:
+ ----- Method: SharedQueue>>setItems: (in category '*file-base') -----
+ setItems: anOrderedCollection
+ 	contentsArray := anOrderedCollection asArray!

Item was changed:
  ----- Method: FileFtpExecutive>>ftpParseEntryOld: (in category 'ftp client') -----
  ftpParseEntryOld: ftpEntry
  	| tokens longy dateInSeconds thisYear thisMonth |
  	thisYear := Date today year.
  	thisMonth := Date today monthIndex.
  	tokens := ftpEntry findTokens: ' '. 
  
  	tokens size = 8 ifTrue:
  		[((tokens at: 6) size ~= 3 and: [(tokens at: 5) size = 3]) ifTrue:
  			["Fix for case that group is blank (relies on month being 3 chars)"
+ 			tokens := tokens copyReplaceFrom: 4 to: 3 with: {'blank'}]].
- 			tokens _ tokens copyReplaceFrom: 4 to: 3 with: {'blank'}]].
  	tokens size >= 9 ifFalse:[^nil].
  
  	((tokens at: 6) size ~= 3 and: [(tokens at: 5) size = 3]) ifTrue:
  		["Fix for case that group is blank (relies on month being 3 chars)"
  		tokens := tokens copyReplaceFrom: 4 to: 3 with: {'blank'}].
  
  	tokens size > 9 ifTrue:
  		[longy := tokens at: 9.
  		10 to: tokens size do: [:i | longy := longy , ' ' , (tokens at: i)].
  		tokens at: 9 put: longy].
  	dateInSeconds := self
  		secondsForDay: (tokens at: 7) 
  		month: (tokens at: 6) 
  		yearOrTime: (tokens at: 8) 
  		thisMonth: thisMonth 
  		thisYear: thisYear. 
  
  	^Array with: (tokens last)  "file name"
  			with: dateInSeconds "creation date"
  			with: dateInSeconds "modification time"
  			with: ( (tokens first first) = $d or: [tokens first first =$l]) "is-a-directory flag"
  			with: tokens fifth asNumber "file size"
  !

Item was removed:
- ----- Method: SharedQueue2>>setItems: (in category '*file-base') -----
- setItems: anOrderedCollection
- 	items := anOrderedCollection asOrderedCollection!



More information about the Packages mailing list