Page 1 of 1

Ghost Empty Folders facility.

Posted: 21 Dec 2014 22:34
by TheXYYMan
Hi,

The file manager that I normally use has a 'ghost empty folders' facility, which is very useful. As the name suggests, it gives all empty folders a faded look. I can't find this facility anywhere in XYPlorer, so can I put it forward as a request?

Thanks.

Re: Ghost Empty Folders facility.

Posted: 22 Dec 2014 10:00
by admin
In the tree? Or in the list? Or both?

General answer: There is a reason why XYplorer is the fastest of all file managers: Things like this take time.

Re: Ghost Empty Folders facility.

Posted: 06 Jan 2015 21:33
by Goliath79
General answer: There is a reason why XYplorer is the fastest of all file managers: Things like this take time.
Fastest indeed, but in my case and I'm guessing in XYYMan case has well, having the option would make our work faster. Saving 5 minutes + to check all empty folders is worth waiting a couple of seconds to have the program do it (I'm guessing I don't really know how much time it would take).

Just my take on this subject, I too would appreciate the option.


Keep up the good work.

Re: Ghost Empty Folders facility.

Posted: 06 Jan 2015 23:01
by highend
This was the first thing I requested (three years ago) :) when I came from SpeedCommander. No chance to do it, Don? Even as a tweak for those who don't care if they loose 5ms in execution speed? :tup:

Re: Ghost Empty Folders facility.

Posted: 07 Jan 2015 05:04
by binocular222
Maybe adding switch in Custom File Icon?

Re: Ghost Empty Folders facility.

Posted: 07 Jan 2015 05:13
by TheQwerty
Not exactly what you're after but you could use color filters to highlight empty folders in the list. Unfortunately, it cannot be done in the tree nor does it work with custom file icons.

Previously you could use size:0 to highlight empty items, but to color folders the costly Calculate Folder Sizes option needed to be enabled. With the recently added #empty special property it is much easier:
screenshot.png

Code: Select all

"Empty Files" prop:#empty:1
"Empty Folders" prop:#empty:2
"Empty Files & Folders" prop:#empty:1-2
"Non-Empty Files" prop:#empty:5
"Non-Empty Folders" prop:#empty:6
"Non-Empty Files & Folders" prop:#empty:5-6
I imagine Custom File Icons will eventually gain support for the attribute/property selectors which should fully satisfy this wish, but maybe this helps in the meantime. ;)

Re: Ghost Empty Folders facility.

Posted: 07 Jan 2015 20:57
by klownboy
A bit off topic from the original post, but thanks TheQwerty for enlightening me on the use of multiple returns on property #Empty. I have a few situations in scripts one being the Thumbnail Maintenance script that I have to determine if a folder contains sub folders but no files. Unfortunately after some experimenting, it doesn't appear that I can use combinations of the property #Empty to determine that. I have to resort to using listfolder as in the example below. This works fine, though Don mentioned that he'd be able to determine this with a change to property #Empty much faster that using listfolder.

Code: Select all

   if((property("#Empty", "$cur_folder") == "6") AND (! listfolder($cur_folder,,"1") == "1")) {end confirm("The current folder contains no files but does contain folders.  Do you wish to proceed to rebuild the sub-folders?",,"1","4") == "0", "Aborting thumbnail rebuild...goodbye!";}
Unless I'm missing something? I mentioned in this thread http://www.xyplorer.com/xyfc/viewtopic. ... ty#p115550 if at some point Don might expand the #Empty to allow us to determine if the folder has sub folder with no files or if the other way around, has files but no sub folders. He seems agreeable to that, but I'll followup up only after he's got the Portable Devices behind him.
Thanks,
Ken

Re: Ghost Empty Folders facility.

Posted: 07 Jan 2015 21:24
by TheQwerty
klownboy wrote:to determine if a folder contains sub folders but no files. Unfortunately after some experimenting, it doesn't appear that I can use combinations of the property #Empty to determine that. I have to resort to using listfolder as in the example below. ... Unless I'm missing something?
You're missing the FolderSize SC. ;)

I'm not sure how it compares as far as speed and resources but it seems to work well in a Custom Column Script so it should be okay.

Code: Select all

$itemCount = FolderSize($cur_folder, '<d>+<f>', 0);
$dirCount = GetToken($itemCount, 1, '+');
$fileCount = GetToken($itemCount, 2, '+');
$itemCount = Eval($itemCount);
And if you really want a bit-flag this is a nifty trick:

Code: Select all

$contentsFlags = Eval(FolderSize($cur_folder, '(<d>!=0)*2+(<f>!=0)', 0));
// 0 = Empty
// 1 = Contains only files.
// 2 = Contains only folders.
// 3 = Contains files & folders.

Re: Ghost Empty Folders facility.

Posted: 07 Jan 2015 22:00
by klownboy
Thanks TheQwerty, I will certainly try those methods. That is a cool trick using Eval along with FolderSize, and yes, I did forget about SC FolderSize. I like the fact that SC FolderSize has the non-recursive flag which should speed things up since I'm typically only interested in one folder at a time. I'll run some speed test also. I'm sure they are quite fast maybe within millisecond. In some of my cases, I may be running it on every folder extracted from the each thumbnail cache file, which could be hundreds, so even a millisecond means quite a bit. Thanks again.

Re: Ghost Empty Folders facility.

Posted: 07 Jan 2015 22:21
by Filehero
TheQwerty wrote:And if you really want a bit-flag this is a nifty trick:

Code: Select all

$contentsFlags = Eval(FolderSize($cur_folder, '(<d>!=0)*2+(<f>!=0)', 0));
// 0 = Empty
// 1 = Contains only files.
// 2 = Contains only folders.
// 3 = Contains files & folders.
Cool code, TheQwertz! :appl:


Cheers,
Filehero