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

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Thu Dec 18 01:51:50 UTC 2008


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

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

Name: File-Base-kph.9
Author: kph
Time: 18 December 2008, 1:51:48 am
UUID: c209dd7f-d813-4107-b230-1793f1b6f126
Ancestors: File-Base-kph.8

add: etc returns the file/list off files resulted

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

Item was changed:
  ----- Method: Directory>>addAll: (in category 'directory/container actions') -----
  addAll: someFD
  	
+ 	^ self addAll: someFD relativeTo: nil!
- 	self addAll: someFD relativeTo: nil!

Item was changed:
  ----- Method: Directory>>addAll:relativeTo: (in category 'directory/container actions') -----
  addAll: someFD relativeTo: aBaseDir
  	
  	"someFd must all have the same executor"
  	
  	"we could perform a sort here to handle the other case"
  	
+ 	someFD isEmpty ifTrue: [ ^ #() ].
- 	someFD isEmpty ifTrue: [ ^ self ].
  	
+ 	^ someFD first executive addAll: someFD relativeTo: aBaseDir toDir: self.!
- 	someFD first executive addAll: someFD relativeTo: aBaseDir toDir: self.!

Item was changed:
  ----- Method: FileFtpExecutive>>toDirRemote:addAllLocal:relativeTo:copySelector: (in category 'local/remote file copy') -----
  toDirRemote: aDir addAllLocal: someFD relativeTo: aBaseDir copySelector: aSelector
  
  	"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 |
  	
  	self ftpDo: [ :ftp |
  	
  		map := self toDir: aDir mkpathAll: someFD relativeTo: aBaseDir.
  
  	].
  
  	delay := Delay forMilliseconds: 100.
  	queue := SharedQueue2 new setItems: map copy.
  	done :=  SharedQueue2 new.
   	
  	self class prefFtpParallel timesRepeat: [
  			[
  				[ queue isEmpty ] whileFalse: [ 
  					queue nextOrNil ifNotNilDo: [ :ea | 
  						[ self perform: aSelector withArguments: ea ] ensure: [ done nextPut: ea ].
  					]
  				]
  			] fork.
  		].
  	
  	[ done size < map size ] whileTrue: [ delay wait ]. 
   
+ 	^ map collect: [ :ea | ea second ]!
- 	^ map!

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



More information about the Packages mailing list