[dev] Patch: Gollem - Recognise links to dirs when listing dirs first

Martin Ebourne lists at ebourne.me.uk
Wed Aug 20 02:19:38 PDT 2003


Hi,

As requested here's a patch to make symbolic links to dirs be sorted with
dirs when 'list directories first' is enabled.

Please note that in order to do this efficiently I've made some changes to
VFS.

Previously only the VFS/file backend did anything with symbolic links. It
took the type of the link target and used it for its own type (ie. a link to
a dir became a dir). The VFS/ftp did nothing special with links, apart from
remembering the target. None of the other VFS backends support links to my
knowledge.

The problem with the VFS/file approach is that it 'hides' the link, and the
VFS/ftp approach leaves all the work to the client. I've tried to strike a
balance by adding a new attribute to files returned from listDirectory. I've
added 'linktype' which gives the type of the link target, in just the same
way as 'type' which gives the type of the original file ('**sym' in this
case).

If people don't like this then an alternative would be to make both backends
behave like file did.

For performance I also implemented isFolder in VFS/ftp. It now trys to chdir
to the parameter and uses success and failure of that. (Rather than checking
the listing of the parent directory.)

Please note that although I've tested the gollem/ftp combination I've not yet
had chance to try the file backend, so the changes in that file have only
been visually checked. Please code review them before submitting! [And if
anyone else can test it...]

I have a question following on from what I found when making this change.
When displaying the directory page the directory is listed from the ftp
server twice. The cause is a second listing for directories only, made by
manager.php calling Gollem::flistSelect. This eventually sets $folder_options
but I can't see when this is ever used. Is there a reason for this second
listing? I'd like to remove it if it's not used.

One minor bug - enter does not work when using the little change directory
dialogue.

Cheers,

Martin.

PS. A bug I've just found in Imp - if I save draft on a message with an
attachment, and then later resume, the attachment is lost.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dirlinks.diff
Type: text/diff
Size: 7795 bytes
Desc: Patch to horde
Url : http://lists.horde.org/archives/dev/attachments/20030820/d018aa03/dirlinks-0001.bin


More information about the dev mailing list