Counting space of folders silently fails
Moderators: Hacker, petermad, Stefan2, white
Counting space of folders silently fails
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.
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 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
- ghisler(Author)
- Site Admin
- Posts: 50555
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
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
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.
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
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Dalai,
Roman
Why?calculating space is not done via TC admin tool because that would be slow (as hell)
Yes, at least something.I suggest to at least indicate that the count is incomplete. Maybe by adding a "+" at the end of the size?
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.
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.Hacker wrote:Why?calculating space is not done via TC admin tool because that would be slow (as hell)
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
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
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.
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
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Dalai,
Roman
That's why TC would request them only when necessary.He doesn't want TC to bother users with (unnecessary) requests for admin permissions
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 againI want to know why something requests higher permissions before granting them (and the UAC doesn't tell anything).
Yes, sure, why not.TC would still need to mark the count as incomplete in case even the admin tool can't read/count certain directories
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.