#! ./perl
BEGIN { $| = 1;
print
"1..5\n"
; }
END {
print
"not ok 1\n"
unless
$loaded
;}
$loaded
= 1;
print
"ok 1\n"
;
open
TEST,
"> /tmp/test.pl.$$"
or
die
"couldn't create temp. file - please try again"
;
unlink
"/tmp/test.pl.$$"
;
fsync(\
*TEST
) ||
print
'not '
;
print
"ok 2\n"
;
fsync(TEST) ||
print
'not '
;
print
"ok 3\n"
;
$fd
=
fileno
(TEST);
File::Sync::fsync_fd(
$fd
) ||
print
'not '
;
print
"ok 4\n"
;
close
TEST;
$fh
= new FileHandle
"> /tmp/test.pl.$$"
or
die
"couldn't create temp. file - please try again"
;
unlink
"/tmp/test.pl.$$"
;
$fh
->fsync() ||
print
'not '
;
print
"ok 5\n"
;