FTP/ServerDIrectory issue in Morphic FileList but not MVC FileList

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FTP/ServerDIrectory issue in Morphic FileList but not MVC FileList

timrowledge
Is anyone actually using FTP ServerDirectory connections?

I’ve been having trouble trying to connect to my server (initially because it seems that you can’t connect to the root - #openFTPClient tries to switch directory and that fails for ‘.' or ‘/' or ‘’, though eventually just using ‘/public' shewed promise even though it isn’t where I want to connect) and there seems to be a problem with how the Morphic version of FileList (which has the tree-view of the directories) attempts to get suitable labels for each node. The MVC version - which fakes the tree view in ugly ways - doesn’t fail in this particular manner.

So far as I can see right now the first level cause of the problem is IndentingListItemMorph>>getLabel. That takes us eventually to PluggableTreeItemNode>asString, and to FileList>directoryNameOf: where we at last start to see some ServerDirectory specific bits. The problem seems to be that we are only looking for a dictionary key matching the *root* of the ftp connection and anything else is an error. So unsurprisingly that fails for any subdirectory we try to look at when expanding the tree node.

If I change FileList>>directoryNameOf: aDirectory to-

        "Attempt to find the name of ServerDirectories when used."

        ^(aDirectory isRemoteDirectory and:[aDirectory isKindOf: ServerDirectory])
                ifTrue:[ServerDirectory servers keyAtIdentityValue: aDirectory ifAbsent:[aDirectory localName]]
                ifFalse:[aDirectory localName]

… then the FileList actually sorta works.  I’d say that somewhere we ought to be filtering out the . & .. directory entries though.

Since the apparently broken code is datestamped in 2010 I’m drawn to the conclusion that no one has used FTP stuff in a while ;-)
Hopefully I’m wrong and someone will tell me a better solution.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
atheism: not a religion, more a personal relationship with reality.