Count only dirs that hava files

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Count only dirs that hava files

Post by *solid »

I have quite large dir tree, consisted of many subdirs, but only dirs on last level contain files. Not all dirs are same depth. I need to count only the dirs that contains files, but not the dirs containing subdirs. Any idea for simplest/fastest approach?
User avatar
ehab
Senior Member
Senior Member
Posts: 271
Joined: 2007-10-29, 07:41 UTC
Location: Libya

Post by *ehab »

do a search

plugin section

use
tc
type is folder

and

use
dirsizecalc

and set size bigger than 1

i didn't try this but let me know if it works.
#181344 Personal licence
User avatar
MVV
Power Member
Power Member
Posts: 8713
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Size won't help since parent folder that contain only subfolder will have even larger size.
AFAIK dirsizecalc should have something like 'files count'.
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

2ehab
Sorry, that doesn't work. Finds all the folders.

2MVV
Filecount also counts all files in the folders, and finds all folders.

Luckilly, dirsizecalc supports definition of custom fields, so i defined a field file count without recursion, so it only counts files on current folder level. That way I can search for folders with filecount>0 and TC can find only folders that actually contains files, not folders that have folders with files.
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2solid
Great to hear that you find a way to utilize DirSizeCalc to do the job.
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

2Lefteous
Thanks for great plugin.
If you could just add possibility for defining custom unit sizes, it will be even greater.
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2solid
If you could just add possibility for defining custom unit sizes, it will be even greater.
Can you explain what this could be and why you need it?
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

2Lefteous

To define a custom size, let's say name: 4GB-usb, size 4GB. So the value of a folder with size 6GB will be 1,5, or size 2GB will display as 0,5.
CD or DVD are also very useful custom unit sizes.
It is useful to check if folder/file will fit on that media or how many of that media will be needed. I know that this cannot be 100% accurate, depending on filesystem used etc., but will give a very good approximation.
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2solid
I see - very interesting indead for those who still use such media.
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

2Lefteous
Any chance to get implemented?
Post Reply