Is there such software?
If not, can anyone show me how to code it in C++?
find / -size 0 -type d -print | xargs rmdir
I'll try that
Can i have the full code, please?
I just learned ''Hello World!''...
If this helps i'm using Visual C++ Express (etc)
That's a DOS command, not C++. Press Win+R, type 'cmd', then type all that into the window that opens.
It doesn't work for me.
Doesn't run or just doesn't work? If the latter... do empty directories really have zero size? Thinking out loud here.
Well, it works fine in Linux and HP-UX. Install cygwin and it should work on Windows, too ;)
"xargs" isn't recognized...
I'm not sure it would work even on Linux, SSH. :P The size of a directory (which is just a file that is a directory) has nothing to do with its contents, right? Mine are all 4096b, whatever they contain.
Quote from: SSH on Wed 25/06/2008 22:04:36
Quote from: matti on Wed 25/06/2008 21:59:54
"xargs" isn't recognized...
by what?
The windows console (cmd.exe).
Something like:" 'xargs' is spelled wrong or couldn't be found"..
Like SSH said, that's a linux/unix command, you can install cygwin (http://www.cygwin.com) and get those tools on Windows. Or if you'd prefer here's a python (http://www.python.org) program to do it:
import os
for dir, subdirs, files in os.walk("/"):
if not files and not subdirs: os.rmdir(dir)
Now it says something about loops.
If you get an error you should explain the error exactly and write it out word for word.
Now it says:
''failed to remove '(path)': no such file or directory
if you had bothered searching you would have found both this (http://www.pcmag.com/article2/0,1759,805015,00.asp) and this (http://simonwai.com/developments/empty_folder_nuker/) amongst other things.
Thanks. Just what i've been looking for