Published in: Perl
#!/usr/bin/perl -w use strict; # # List empty directories # perl administration posix # # set start path sub checkpath { # open path or die # debug #print "I am here: $path\n"; # get directory content but skip . and .. (to avoid circular looping) # print directory name and exit if empty if (!@content) { print "$path\n"; } # recurse trough directories checkpath($path.'/'.$subpath); } } checkpath($startpath);
Comments
Subscribe to comments
You need to login to post a comment.

Previous version was not doing the expected job