line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# File::Sync.pm |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright © 1997,1999 Carey Evans. All rights reserved. This module is |
4
|
|
|
|
|
|
|
# free software; you can redistribute it and/or modify it under the same |
5
|
|
|
|
|
|
|
# terms as Perl itself. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package File::Sync; |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
5917
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
164
|
|
10
|
4
|
|
|
4
|
|
21
|
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
2015
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
require Exporter; |
13
|
|
|
|
|
|
|
require DynaLoader; |
14
|
|
|
|
|
|
|
require AutoLoader; |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
4
|
|
25
|
use Carp; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
408
|
|
17
|
4
|
|
|
4
|
|
31331
|
use Symbol qw(qualify_to_ref); |
|
4
|
|
|
|
|
12406
|
|
|
4
|
|
|
|
|
1155
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
@ISA = qw(Exporter DynaLoader); |
20
|
|
|
|
|
|
|
# Items to export into callers namespace by default. |
21
|
|
|
|
|
|
|
@EXPORT = (); |
22
|
|
|
|
|
|
|
@EXPORT_OK = qw( |
23
|
|
|
|
|
|
|
sync |
24
|
|
|
|
|
|
|
fdatasync |
25
|
|
|
|
|
|
|
fsync |
26
|
|
|
|
|
|
|
fdatasync_fd |
27
|
|
|
|
|
|
|
fsync_fd |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
$VERSION = '0.11'; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
bootstrap File::Sync $VERSION; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Preloaded methods go here. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Interface from Perl filehandle to POSIX file descriptor. |
36
|
|
|
|
|
|
|
sub fsync(*) { |
37
|
5
|
100
|
|
5
|
0
|
844195
|
@_ == 1 or croak "usage: fsync FILEHANDLE"; |
38
|
|
|
|
|
|
|
|
39
|
3
|
|
|
|
|
29
|
fsync_fd(fileno(qualify_to_ref($_[0], caller()))); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub fdatasync(*) { |
43
|
2
|
50
|
|
2
|
0
|
252261
|
@_ == 1 or croak "usage: fdatasync FILEHANDLE"; |
44
|
|
|
|
|
|
|
|
45
|
2
|
|
|
|
|
20
|
fdatasync_fd(fileno(qualify_to_ref($_[0], caller()))); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
## Make fsync available as a method of FileHandle |
49
|
|
|
|
|
|
|
*FileHandle::fsync = \&fsync; |
50
|
|
|
|
|
|
|
# note: we no longer clobber IO::Handle::fsync. see POD for more. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
__END__ |