ext4, fsync(2), and perl

Chan Chung Hang Christopher christopher.chan at bradbury.edu.hk
Fri Mar 5 14:54:40 UTC 2010


Josef Wolf wrote:
> On Fri, Mar 05, 2010 at 05:38:19PM +0800, Christopher Chan wrote:
>> On Friday, March 05, 2010 04:13 PM, Josef Wolf wrote:
>>> On Fri, Mar 05, 2010 at 10:37:04AM +0800, Christopher Chan wrote:
>>>> On Friday, March 05, 2010 03:19 AM, Josef Wolf wrote:
>>> This tells me I have to use IO::Handle::sync() instead. The POSIX manpage
>>> states that fsync is deprecated. This is why I used IO::Handle in my original
>>> example.
>> IO::Handle is for files only? I doubt that it will work with directories.
> 
> Yeah, makes sense. But IO::Dir don't have a sync() method. So how am I
> supposed to do what Ted Ts'o is recommending?

It appears that they removed fsync in 2004...for perl 5.8


> 
>> POSIX manpage says fsync is deprecated? That is highly impossible...not 
>> if they want just about every program rewritten.
> 
> I am talking about perl's posix(3pm) manpage. The real posix standards
> would hardly talk about IO::Handle, would they?
> 
> And it's not only posix(3pm) saying that fsync is deprecated. When I try to
> use perl's fsync, it also tells me to use IO::Handle instead.
> 
> 

Looked through the perl source...fsync only on file...they do not do it 
on the dir...there was a post about this:

http://www.gossamer-threads.com/lists/perl/porters/236839

All I can say is that it does not look possible at this point...

perl source reference:
grep -r fsync ../ext/IO/
../ext/IO/ChangeLog:      - Added fsync, but will not be avaliable for use
../ext/IO/IO.xs:fsync(handle)
../ext/IO/IO.xs:            RETVAL = fsync(PerlIO_fileno(handle));
../ext/IO/hints/sco.pl:# SCO OSR5 needs to link with libc.so again to 
have C<fsync> defined
../ext/IO/lib/IO/Handle.pm:for an invalid handle. See L<fsync(3c)>.




More information about the ubuntu-users mailing list