[Pkg] Rio: File-Base-kph.21.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Tue Mar 3 14:07:05 UTC 2009


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

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

Name: File-Base-kph.21
Author: kph
Time: 3 March 2009, 2:06:54 pm
UUID: 8da1bd5c-07fc-11de-bb3d-000a95edb42a
Ancestors: File-Base-test.20

return the destinations from a bulk file transfer

=============== Diff against File-Base-test.20 ===============

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 |
- 	| queue map done delay flg dest |
  	
  	flg := FileNotification isOverwrite.
  
  	self ftpDo: [ :ftp |
  		map := self toDir: aDir mkpathAll: someFD relativeTo: aBaseDir.
  		
+ 		transfers := map select: [ :ea | 
+ 			dest := ea value.
- 		map := map select: [ :ea | 
- 			dest := ea second.
  			dest isDirectory not and: [ flg or: [ dest exists not ] ]
  		]
  	].
  
  	delay := Delay forMilliseconds: 100.
+ 	queue := SharedQueue2 new setItems: transfers copy.
- 	queue := SharedQueue2 new setItems: map 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 ].
- 						[ self perform: aSelector withArguments: ea ] ensure: [ done nextPut: ea ].
  					]
  				]
  			] fork.
  		].
  	
+ 	[ done size < transfers size ] whileTrue: [ delay wait ]. 
- 	[ done size < map size ] whileTrue: [ delay wait ]. 
   
+ 	"return all the destinations"
+ 	^ map collect: [ :ea | ea value ]
+  !
- 	^ map collect: [ :ea | ea second ]!

Item was changed:
  ----- Method: Directory>>add: (in category 'directory/container actions') -----
  add: aFD
  		 
+ 	^ (self addAll: (Array with: aFD)) first
- 	^ self addAll: (Array with: aFD)	 
  		
  "
  	self assert: (('a' asDirectory mkpath add: 'b' asFile touch)  = 'a/b' asFile)
  "!



More information about the Packages mailing list