Or is this just a bug in IO::Handle?
Mostly yes, IO::Handle::sync requires a file handle open with write access.
The following workaround may work:
use IO::Handle; sysopen my $dh, "/etc/", 0 or die "unable to open dir"; open my $dh1, ">&", $dh or die "unable to dup handle"; $dh1->sync or die "dir sync failed";
In reply to Re: fsyncing directories
by salva
in thread fsyncing directories
by betterworld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |