<?xml version="1.0" encoding="windows-1252"?>
<node id="997007" title="Re: How do I copy an empty directory?" created="2012-10-03 04:33:33" updated="2012-10-03 04:33:33">
<type id="11">
note</type>
<author id="920017">
pvaldes</author>
<data>
<field name="doctext">
&lt;c&gt;#!/usr/bin/perl
use File::Find;

finddepth (\&amp;empdir, ($ARGV[0] || '.'));

sub empdir {
   return unless -d &amp;&amp; rmdir($_);
   mkdir "/tmp/$_";
}&lt;/c&gt;

&lt;p&gt;Works for me in GNU. Any "empty" directory having only empty subdirectories will be deleted also (as the empty subdirs). Adapt the line 7 to your needs&lt;/p&gt;</field>
<field name="root_node">
996906</field>
<field name="parent_node">
996906</field>
</data>
</node>
