photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: Gerd on October 07, 2013, 05:09:40 PM

Title: How to find empty folders?
Post by: Gerd on October 07, 2013, 05:09:40 PM
Hi,

I have deleted a lot pictures (test-pictures) from my category "Test".

How can I now find the empty directorys to delete them?
Title: Re: How to find empty folders?
Post by: JohnZeman on October 07, 2013, 06:08:10 PM
The attached script should do it.

Edit: Slightly modified the script so it only searches for empty folders that do not have any subfolders.

[attachment deleted by admin]
Title: Re: How to find empty folders?
Post by: BenAW on October 07, 2013, 06:11:15 PM
Otherwise set the "Show Counts" option in the Configure dialog to ON.
Count = 0 indicates an empty folder  :)
Title: Re: How to find empty folders?
Post by: Gerd on October 07, 2013, 07:15:42 PM
Thanks , John and Ben,

but this does not help..  ???

If I see the counts = 0, then I have manually to oipen all folder levels and look ...

If I run John's script, a) it allways start with the first drive-letter and not by the actual folder, b) I can do nothing, if a folder is found, only to search for the next ...

Is there no easy possibility to e.g. filter folder via expression for zero content so that I can delete them?
Title: Re: How to find empty folders?
Post by: JohnZeman on October 07, 2013, 07:55:03 PM
I don't understand what's happening when you run the script Gerd.  All it should do is to step through all of the folders in your database.  When it finds an empty folder that contains no subfolders it should stop right there at that folder and pop up a message box that gives you the choice to look for more empty folders, or to exit the script so you can work with the empty folder it stopped on.
Title: Re: How to find empty folders?
Post by: Gerd on October 07, 2013, 08:50:51 PM
Hi John,

yes, so it is working ... but I have a c: and a h: drive. the c: drive contains a lot of empty folders, that I'm not intersted in, only that on the h: drive are important. Your script starts everytime with the c: drive, so I have to skip manually everytime nearly 50 folders before it comes to the h: drive ...

May be you can change it, that it starts with the actual selected folder ....
Title: Re: How to find empty folders?
Post by: JohnZeman on October 07, 2013, 10:31:01 PM
Ok, try the one I've attached to this message instead, it should only search the H: drive.

[attachment deleted by admin]
Title: Re: How to find empty folders?
Post by: Gerd on October 07, 2013, 10:33:17 PM
Thx John!

I'll try!
Title: Re: How to find empty folders?
Post by: Gerd on October 09, 2013, 12:32:09 PM
Hi John,

thanks again ... it's working fine and helps me a lot!  ;)
Title: Re: How to find empty folders?
Post by: JohnZeman on October 09, 2013, 02:45:27 PM
Glad to know it's working for you Gerd. ;D
Title: Re: How to find empty folders?
Post by: Gerd on October 09, 2013, 03:06:46 PM
Hi John,

I have modified a little bit ... I took out the yes/no-message-box, so after a <Del> I could so immediately click on the green run-icon, keep my mouse-pointer place there and if a new empty directory was found, directly delete with <Del>-key. So it was only a click-click-action ... very quick done.  ;)
Title: Re: How to find empty folders?
Post by: JohnZeman on October 09, 2013, 03:21:33 PM
There ya go.  ;)
Title: Re: How to find empty folders?
Post by: Mario on October 09, 2013, 09:06:36 PM
Since there is already a hide empty folders feature in the Folder Filter  (under the Media & Folders tree), maybe somebody should add a feature request for a "hide non-empty folders". If checking for empty folders is required often...