Implemented by initially writing to an temporary file name, and renaming as the
last act.
my $IsMSWin32 = $^O eq 'MSWin32' && !$IsSymbian;
unlink "Errno.pm" if -f "Errno.pm";
-open OUT, ">Errno.pm" or die "Cannot open Errno.pm: $!";
+unlink "Errno.tmp" if -f "Errno.tmp";
+open OUT, ">Errno.tmp" or die "Cannot open Errno.tmp: $!";
select OUT;
my $file;
my @files = get_files();
}
write_errno_pm();
unlink "errno.c" if -f "errno.c";
+rename "Errno.tmp", "Errno.pm" or die "Cannot rename Errno.tmp to Errno.pm: $!";
sub process_file {
my($file) = @_;