Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: fsyncing directories

by ikegami (Patriarch)
on Apr 27, 2010 at 12:51 UTC ( [id://837093]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-20 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found