[squeak-dev] The Inbox: Network-vd.263.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Aug 15 16:10:57 UTC 2022
A new version of Network was added to project The Inbox:
http://source.squeak.org/inbox/Network-vd.263.mcz
==================== Summary ====================
Name: Network-vd.263
Author: vd
Time: 15 August 2022, 10:10:53.94751 pm
UUID: 94aff6fb-cd1c-ed11-9140-f0def1d1df96
Ancestors: Network-tonyg.262
ServerDirectory class>>parseFTPEntry:
call to deprecated
DirectoryEntry class>>#name:creationTime:modificationTime:isDirectory:fileSize:
removed
=============== Diff against Network-tonyg.262 ===============
Item was changed:
----- Method: ServerDirectory class>>parseFTPEntry: (in category 'misc') -----
parseFTPEntry: ftpEntry
+ | tokens longy dateInSeconds thisYear thisMonth isDirectory directoryOrFileEntryClass|
- | 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:
[ "cmm: this approach fails for filenames containing two spaces in a row."
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.
+ isDirectory:=((tokens first first) = $d or: [tokens first first =$l]) "is-a-directory flag".
+ directoryOrFileEntryClass:=isDirectory ifTrue: [ DirectoryEntryDirectory ] ifFalse: [ DirectoryEntryFile ].
+
+ ^ directoryOrFileEntryClass
+ directory: nil
+ name: (tokens at: 9) "file name"
+ creationTime: dateInSeconds
+ modificationTime: dateInSeconds
+ fileSize: tokens fifth asNumber "file size".
+ !
- ^DirectoryEntry name: (tokens at: 9) "file name"
- creationTime: dateInSeconds "creation date"
- modificationTime: dateInSeconds "modification time"
- isDirectory: ((tokens first first) = $d or: [tokens first first =$l]) "is-a-directory flag"
- fileSize: tokens fifth asNumber "file size"
- !
More information about the Squeak-dev
mailing list
|