Find dirs of certain size (it defined on specific algorithm)

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Find dirs of certain size (it defined on specific algorithm)

Post by *DrShark »

Hi!
I need to find folders using TC's Find files, size of all files in the root of them matches (=, !=, or >= etc.) some value. Reparse points of all kind must be ignored during search. Can I do it, maybe with some plugins? It seems that DirSizeCalc can't help here, or I can't configure it in right way.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2DrShark
DirSizeCalc works fine for me. This should work by default without further configuration*. Make sure you are using the unit matching the value you entered in the plugin search rule e.g. 20 MB (default is B for bytes).

*For ignoring reparse points you have to use DirSizeCalcSettings.exe and change the Size field settings (or create a custom field).
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

2Lefteous
I updated your plugin to latest version, and tried again. I entered the Size value and match ">=", and the TC with help of the plugin shows me files with the matched size in Find Files results window, at least for highest dir with matched file. That's when I am trying to find folders.
In the following example, testfile.match is a file with size 307 MiB, and Find Files DirSizeCalc rule is: Size field >=300.: MiB
I have tree
\Dir1\Dir2\testfile.match
\Dir1\Dir2\Subdir1\testfile.match
and start Find Files from \Dir1\ with mentioned rule, I expect to see next results:
\Dir1\Dir2\
\Dir1\Dir2\Subdir1\
Instead, I see following:
\Dir1\Dir2\Subdir1\
\Dir1\Dir2\Subdir1\testfile.match
\Dir1\Dir2\testfile.match
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

I get
\Dir1\Dir2\
\Dir1\Dir2\Subdir1\
\Dir1\Dir2\Subdir1\testfile.match

which is correct. If you want to filter out files you have to use settings on the Advanced tab in the search dialog.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

edited

Post by *DrShark »

Lefteous wrote:I get
\Dir1\Dir2\
\Dir1\Dir2\Subdir1\
\Dir1\Dir2\Subdir1\testfile.match

which is correct. If you want to filter out files you have to use settings on the Advanced tab in the search dialog.
For me your results also looks strange. Where then the logic of the plugin if it doesn't show the file \Dir1\Dir2\testfile.match in results?

Sorry for confusing naming in my example, Dir2\ here a subdir of \Dir1\, and Subdir1\ is a subdir of Dir2\. I initially made naming from testfile.match POV.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Mh I just gave it another try and saw that I made a mistake in applying your file structure. Now everything is found as there is no element which doesn't met the criteria. Or which shouldn't be found and why?
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

edited

Post by *DrShark »

2Lefteous
1. From what I understand from your explanation, plugin finds not folders, but individual files that matches Size rule. So in my directory tree it should find and display in results both files and folders from \Dir2\testfile.match and \Dir1\Dir2\Subdir1\testfile.match. However, in my results from first post:
\Dir1\Dir2\Subdir1\
\Dir1\Dir2\Subdir1\testfile.match
\Dir1\Dir2\testfile.match

it's not clear why line \Dir1\Dir2\Subdir1\ is shown, and then why Dir1\Dir2\ is not shown? We start search from \Dir1\ so in plugin's task both \Dir2\ with testfile.match and \Dir2\Subdir1\testfile.match must be treated equally.

2. Returning to my initial needs. Since plugin looks for size of individual files, it seems that it can't do what I want: to count a sum of bytes of all files in root of folder (without subdirs, including reparse points) and return it to TC as a folder size. I tried to add testfile2.match (a copy of 307 MiB testfile.match) to \Dir1\Dir2\Subdir1\ and search using DirSizeCalc rule >= 600 MiB, and got "nothing found".
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2DrShark
it's not clear why line \Dir1\Dir2\Subdir1\ is shown, and then why Dir1\Dir2\ is not shown? We start search from \Dir1\ so in plugin's task both \Dir2\ with testfile.match and \Dir2\Subdir1\testfile.match must be treated equally.
Here Dir1\Dir2\ is found. I really don't know why it doesn't work for you. What happens if you create a custom column with the same field?
Since plugin looks for size of individual files, it seems that it can't do what I want: to count a sum of bytes of all files in root of folder (without subdirs, including reparse points)
I didn't know you don't want recursion. That is just another option to uncheck in DirSizeCalcSettings.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

solved

Post by *DrShark »

Lefteous wrote:2DrShark
it's not clear why line \Dir1\Dir2\Subdir1\ is shown, and then why Dir1\Dir2\ is not shown ...
Here Dir1\Dir2\ is found. I really don't know why it doesn't work for you. What happens if you create a custom column with the same field?
Ok, so for now my task is solved: this strange behavior has been fixed by starting DirSizeCalcSettings.exe, pressing OK in it and restarting Total Commander. Before that, I had DirSizeCalc plugin installed just like any other WDX and I didn't start its config utility. I only had problem with Size field: "Contains files" and "Empty fields" I also used worked right.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2DrShark
Nice to hear that it now works as expected. The restart after using DirSizeCalcSettings is required as TC has no built-in content plugin settings function. I have requested it some time ago (and maybe I'll try it once more).
Post Reply