Counting space of folders silently fails

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
wanderer
Power Member
Power Member
Posts: 1578
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Counting space of folders silently fails

Post by *wanderer »

TC9.12 x64, Win2K12R2.

I executed TC from an administrator user but i did not use "Run As Admin", i just executed it normally. I went to a drive which contained an installation of SQL Server and pressed <Space> on the instance folder. TC counted the space and reported it at the status line without any further message.

So far so good. The problem is that some folders in an SQL server installation (for instance Backup and Data - which contain the actual databases) are not accessible unless you use an elevated instance of TC. So, in my case, the "directory size count" process i initiated when i pressed <Space> probably failed silently on those folders and ended up reporting the wrong size for the specified folder, which was highly misleading since it actually occupied more than 3 times the amount of space TC had reported (~450GB instead of 150).

IMO this should be changed. If TC fails to access a folder while counting the occupied space, it should immediately report it by displaying a message saying something like "some folders are not accessible, reported sizes may be inaccurate. Try running an elevated TC instance". Perhaps it should offer an OK/Cancel set of options, where OK would mean that the user accepts this and wishes for the process to continue and Cancel would just stop.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is intentional. I don't want to bother the user with admin requests when he just selects folders with spacebar.
Author of Total Commander
https://www.ghisler.com
User avatar
RoMa
Junior Member
Junior Member
Posts: 25
Joined: 2003-03-08, 11:38 UTC

Post by *RoMa »

I think TC's current attitude is to be preferred. At least it should stay as default.
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Christian,
Well TC still has the admin token or something for one minute or so, doesn't it? So it's only one request per minute at the worst.
I personally expect TC to show me the correct directory size when I press space (in line with the "show exactly what is on disk" philosophy) and not silently disregard some directories while calculating others' sizes correctly.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2Hacker
Not exactly. The TC admin tool has the admin token. And, IIRC calculating space is not done via TC admin tool because that would be slow (as hell).

However, I agree that there's room for improvement. I suggest to at least indicate that the count is incomplete. Maybe by adding a "+" at the end of the size?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
calculating space is not done via TC admin tool because that would be slow (as hell)
Why?
I suggest to at least indicate that the count is incomplete. Maybe by adding a "+" at the end of the size?
Yes, at least something.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Hacker wrote:
calculating space is not done via TC admin tool because that would be slow (as hell)
Why?
Well, TC would have to either send the name of every subdir to the TC admin tool (which would be slow as hell), or implement a new command in the TC admin tool that does the counting and returns the sum to TC.

However, doing the latter would raise a UAC request everytime the space occupation is done (assuming it's not already started) because TC would have to always do the counting via admin tool as it can't know if it needs the admin permissions beforehand.

And that still doesn't take into account that permissions might be restricted even to admins, like the System Volume Information directory has always been. Furthermore there's an increasing number of directories on Win8.1 and 10 that even administrators don't have permissions to read (e.g. C:\ProgramData\Microsoft\Windows\SystemData). So, counting as admin is not a reliable way in every scenario, only marking the count as incomplete gives a clue that "there's more" and permissions may be too restrictive.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
Thanks. True.
Then perhaps TC could count by itself but whenever it encountered a dir it wouldn't be able to read it could ask the user for admin permissions and leave the counting to the admin tool, hoping the sizes counted so far have been cached? Better than nothing?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Well, as Ghisler said above: He doesn't want TC to bother users with (unnecessary) requests for admin permissions which is understandable. It would certainly annoy me because I want to know why something requests higher permissions before granting them (and the UAC doesn't tell anything).

Even if it were implemented like this, TC would still need to mark the count as incomplete in case even the admin tool can't read/count certain directories. Otherwise it would still be a misleading number/count, just like it is now.

Unfortunately, things like this are not as easy as they may look at first glance...

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
He doesn't want TC to bother users with (unnecessary) requests for admin permissions
That's why TC would request them only when necessary.
I want to know why something requests higher permissions before granting them (and the UAC doesn't tell anything).
I am sure this can be solved by a simple message box from TC? Some file / folder sizes could not be calculated, try with admin rights? Yes / No / [ ] Don't ask again
TC would still need to mark the count as incomplete in case even the admin tool can't read/count certain directories
Yes, sure, why not.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply