[Pkg] Rio: Rio-Grande-kph.43.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Fri Nov 7 15:14:17 UTC 2008


A new version of Rio-Grande was added to project Rio:
http://www.squeaksource.com/Rio/Rio-Grande-kph.43.mcz

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

Name: Rio-Grande-kph.43
Author: kph
Time: 7 November 2008, 3:14:14 pm
UUID: 4dac9678-1075-430a-b647-9171b54d2f10
Ancestors: Rio-Grande-kph.42

fixed filenames with spaces

=============== Diff against Rio-Grande-kph.42 ===============

Item was changed:
  ----- Method: RioFtpFileSystem>>ftpParseEntry: (in category 'as yet unclassified') -----
  ftpParseEntry: ftpEntry
+ 	| permissions rs dateInSeconds thisYear thisMonth unkown user group size month day time filename |
- 	| tokens longy dateInSeconds thisYear thisMonth |
  	thisYear := Date today year.
  	thisMonth := Date today monthIndex.
+ 
+ 	rs := ftpEntry readStream.
+ 	
+ 	permissions := rs upToSeparator.
+ 
+ 	permissions size < 10 ifTrue: [ ^ nil ].
+ 	
+ 	rs skipSeparators.
+ 	
+ 	unkown := rs upToSeparator.
+ 
+ 	rs skipSeparators.
+ 
+ 	user := rs upToSeparator.
+ 
+ 	rs skipSeparators.
+ 	
+ 	group := rs upToSeparator.
- 	tokens := ftpEntry findTokens: ' '. 
  
+ 	rs skipSeparators.
- 	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 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'}].
  
+ 	size := rs upToSeparator.
+ 
+ 	rs skipSeparators.
+ 
+ 	month := rs upToSeparator.
+ 
+ 	rs skipSeparators.
+ 
+ 	"Fix for case that group is blank (relies on month being 3 chars)" 
+ 	(size size = 3 and: [ size asNumber = 0 ]) ifTrue: [
+ 
+ 		month := size.
+ 		size := group.
+ 		group := 'blank'.
+ 
+ 	].
+ 
+ 	day := rs upToSeparator.
+ 
+ 	rs skipSeparators.
+ 	
+ 	time := rs upToSeparator.
+ 
+ 	rs skipSeparators.
+ 	
+ 	filename := rs upToEnd.
+ 		
- 	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: day 
+ 		month: month 
+ 		yearOrTime: time 
- 		secondsForDay: (tokens at: 7) 
- 		month: (tokens at: 6) 
- 		yearOrTime: (tokens at: 8) 
  		thisMonth: thisMonth 
  		thisYear: thisYear. 
  
+ 	^Array with: filename  "file name"
- 	^Array with: (tokens last)  "file name"
  			with: dateInSeconds "creation date"
  			with: dateInSeconds "modification time"
+ 			with: ( (permissions first) = $d or: [permissions first =$l]) "is-a-directory flag"
+ 			with: size asNumber  "file size"
- 			with: ( (tokens first first) = $d or: [tokens first first =$l]) "is-a-directory flag"
- 			with: tokens fifth asNumber "file size"
  !

Item was added:
+ ----- Method: PositionableStream>>upToSeparator (in category '*rio-grande') -----
+ upToSeparator 
+ 	"Answer a subcollection from the current access position to the 
+ 	occurrence (if any, but not inclusive) of anObject in the receiver. If 
+ 	anObject is not in the collection, answer the entire rest of the receiver."
+ 	| newStream element |
+ 	newStream := WriteStream on: (collection species new: 100).
+ 	[self atEnd or: [(element := self next) isSeparator]]
+ 		whileFalse: [newStream nextPut: element].
+ 	^newStream contents!

Item was added:
+ ----- Method: RioFtpFileSystem>>ftpParseEntryOld: (in category 'as yet unclassified') -----
+ 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 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"
+ !



More information about the Packages mailing list