in reply to fsyncing directories

IO::Handle's sync requires an output file handle. I don't know if Perl provides a means of getting an output file handle to a directory. Otherwise, it's just a wrapper for C's fsync.

Update: You can get one via dup:

$ perl -MIO::Handle -e' open(my $fh, "<", $ARGV[0]) or die; open(my $ofh, ">&", $fh) or die; $ofh->sync or die; print "success\n" ' some_dir success