Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: fsyncing directories

by betterworld (Deacon)
on Apr 27, 2010 at 12:09 UTC ( #837087=note: print w/ replies, xml ) Need Help??


in reply to Re: fsyncing directories
in thread fsyncing directories

Thanks, File::Sync seems to work:

use File::Sync qw(fsync); open my $f, '/tmp' or die $!; fsync($f) or die "fsync: $!\n";

I should have done a CPAN search myself...

However, IO::Handle is a core module, File::Sync isn't. As IO::Handle already has a sync() method (and perldoc POSIX documents that this is how to do fsync), it seems a bit excessive to pull in CPAN modules just because your file handle is a directory handle...


Comment on Re^2: fsyncing directories
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://837087]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2015-07-02 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (27 votes), past polls