DelEmpty - lists/erases empty dirs

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

DelEmpty - lists/erases empty dirs

Post by *Hacker »

Hi,
Having seen many requests / questions about how to easily delete empty dirs, I wrote a small tool that can do this.
http://thehacker.host.sk/myfiles/ and there DelEmpty.zip.
Sources are available upon request.

HTH
Roman
User avatar
norfie
Power Member
Power Member
Posts: 1194
Joined: 2003-02-18, 14:18 UTC

Post by *norfie »

Last edited by norfie on 2004-09-11, 07:51 UTC, edited 1 time in total.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

2Hacker
It shows me correctly the empty directories. It even says "DELETING...." but... the directories still exist.

I use it like this e.g.:

delempty c:\test\a del fp

I work on WinNT.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

norfie,
You're welcome. :)

djk,
Hmm, I can reproduce it on W2K... Will take another look at it when I'm home.

Thanks
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.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

2Hacker
On Win98 it also works ok. I wil be waiting for your testing.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

OK, DelEmpty 1.01 is available, the bug should be fixed.

Thanks
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.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

2Hacker
Unfortunately it still doesn't work but now it says: "FAILED." Any ideas?
I've tried it both on FAT16 and NTFS. I work with full admin rights.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Darnit no, I don't know, I can reproduce it, though. This time I used the Win32API removedirectory function with the dirname as parameter. Would someone take a look at the code, please? It's rather short. I'll upload it tomorrow. And I'll try to add some debug info. Anyways, we'll see.
And does someone know where to get the newest version of the Win32API Help?

TIA
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.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

If you're patient...

Post by *Clo »

2Hacker
:)   Hi Roman,
And does someone know where to get the newest version of the Win32API Help?
• Following my friend Pierre Gougelet (XnView), have a look at msdn.com ...
:mrgreen: Friendly regards,
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

I have been doing that for the last 30 minutes and couldn't find any downloadable help files regarding the Windows SDK there... (

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.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Mess---

Post by *Clo »

2Hacker
• Sorry, I didn't get the exact archive file-name from Pierre...
To find anything at MS' is a pretty mess, especially when it's for free. :P
Maybe could you try a search using the old version file-name ?
:mrgreen:  KR
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Maybe could you try a search using the old version file-name ?
Well, the problem is that there is no single filename... when I installed Delphi then these help files got installed under Program Files\Common Files\Borland Shared\MSHelp\ and there are about 20 HLP files each called by win32.hlp AFAI understand it.
Oh well. Thanks for trying.

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.
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

Hi Roman, what exactly is the problem, finding that the dir is empty or deleting it?

Following is an excerpt from RemoveDirectory MSDN specs, note the return value that you can check and also GetLastError. Check the remark it might be that your problem is a direct result of it.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
The RemoveDirectory function marks a directory for deletion on close. Therefore, the directory is not removed until the last handle to the directory is closed.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Would someone take a look at the code, please?
I would, please send it by e-mail or post it to your site.

Btw, if you recursively search subdirs for contained empty dirs, don't forget to call FindClose() on the dir handle, otherwise the dir cannot be deleted.
Author of Total Commander
https://www.ghisler.com
Sven
Member
Member
Posts: 111
Joined: 2003-02-10, 21:32 UTC
Location: Varel, Germany
Contact:

Post by *Sven »

Hacker wrote:I have been doing that for the last 30 minutes and couldn't find any downloadable help files regarding the Windows SDK there... (

Roman
Online install: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

Full download: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
Post Reply