Re: UP-DIR - did I miss something ?



On Thu, 23 Oct 2003, Michal Szwaczko wrote:

> I can't seem to track down the change in the panel representation of
> up-dir size. It used to be the size of the node in number, but now it
> prints 'UP-DIR'.
>
> It's not the problem whatsoever, but I am curious if there's some
> technical rationale behind it discussed here (which I obviously had
> missed if it was) or any other reason for this. I would appreciate the
> explanation. For me it's just annoying.
>
> If nobody resists codewise, I would propose changing it back to the old
> behaviour.

The problem is that finding the size of the ".." directory is time
consuming on VFS.  Suppose we are in /foo/bar/baz on FTP server.  ".." is
/foo/bar.  To find the size of /foo/bar, we should request listing of /foo
and get the size of "bar" from it.

More realistic example is that you are in /home/user and you descend to
/home/user/tmp.  Suddenly mc requests the listing of /home/, which can be
really huge on systems with thousands of users.

Yes, it's possible to get the size of ".." from the local listing in many
cases, but there are broken FTP servers that don't list ".." or list int
incorrectly, so the ".." entry is added automatically.  Information about
".." from the listings is discarded.

Also, VFS doesn't know the intention of mc, i.e. whether it does mc_stat()
just to show the size or the directory or for some other reason.  I
believe certain properties of the parent directory cannot be extracted
from the local listing, at least for some FTP servers.

I don't want to make mc_stat("..") a special case.  I don't want to add
code to ftpfs to list only certain entries - it adds complexity to the
cache level.  In fact, I don't want to add any complexity to VFS - it's
already hard to understand.

Finally, some users expected that the size of ".." is the size of the
current directory, not the parent directory.  I don't want mc to be
confusing, even if it's correct.

All this was discussed in the mailing list long ago, before 4.6.0 release.

-- 
Regards,
Pavel Roskin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]