2006-11-21から1日間の記事一覧

IO::Fileでの同期制御

use IO::File; # "w" or "> $f" my $fh = IO::File->new($f, O_WRONLY|O_TRUNC|O_CREAT|O_SYNC, 0644) or die "Can not open $f: $!\n"; print $fh .... ; $fh->close; O_SYNCはOSによって違うかもしれない(LinuxはO_SYNC。これはopen(2)を参照)。