From 97315924f561c56cef3b581691409d4217f5c1b5 Mon Sep 17 00:00:00 2001 From: djk Date: Thu, 3 Jun 1999 21:19:43 +0000 Subject: [PATCH] changed all instances of FileHandle to IO::File --- Changes | 1 + perl/DXCommandmode.pm | 4 ++-- perl/DXCron.pm | 4 ++-- perl/DXDebug.pm | 1 - perl/DXLog.pm | 4 ++-- perl/DXLogPrint.pm | 2 +- perl/DXMsg.pm | 15 ++++++++------- perl/Geomag.pm | 4 ++-- perl/Julian.pm | 1 - perl/Prefix.pm | 3 ++- perl/Spot.pm | 2 +- perl/connect.pl | 2 +- perl/gdx.pl | 2 +- 13 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Changes b/Changes index a57bf25b..85b364f5 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,7 @@ appropriate. also reformat PC19 for onward broadcast so that nodes coming in on loops are dropped from those broadcasts. 3. make sure PC16,17,19,21 doen't affect locally connected nodes. +4. Changed all instances of FileHandle to IO::File. 01Jun99======================================================================= 1. removed a output of an unwanted pc21 for isolated nodes 31May99======================================================================= diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 331ca00e..24d3f0a9 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -21,7 +21,7 @@ use DXLog; use DXLogPrint; use DXBearing; use CmdAlias; -use FileHandle; +use IO::File; use Filter; use Carp; @@ -509,7 +509,7 @@ sub find_cmd_name { } else { delete_package($package) if defined $Cache{$package}{mtime}; - my $fh = new FileHandle; + my $fh = new IO::File; if (!open $fh, $filename) { $errstr = "Syserr: can't open '$filename' $!"; return undef; diff --git a/perl/DXCron.pm b/perl/DXCron.pm index 94c1cad0..c0565fa1 100644 --- a/perl/DXCron.pm +++ b/perl/DXCron.pm @@ -12,7 +12,7 @@ use DXVars; use DXUtil; use DXM; use DXDebug; -use FileHandle; +use IO::File; use Carp; use strict; @@ -58,7 +58,7 @@ sub init sub cread { my $fn = shift; - my $fh = new FileHandle; + my $fh = new IO::File; my $line = 0; dbg('cron', "cron: reading $fn\n"); diff --git a/perl/DXDebug.pm b/perl/DXDebug.pm index df3cb027..63260231 100644 --- a/perl/DXDebug.pm +++ b/perl/DXDebug.pm @@ -17,7 +17,6 @@ require Exporter; use strict; use vars qw(%dbglevel $fp); -use FileHandle; use DXUtil; use DXLog (); use Carp; diff --git a/perl/DXLog.pm b/perl/DXLog.pm index f089d73d..8281e154 100644 --- a/perl/DXLog.pm +++ b/perl/DXLog.pm @@ -29,7 +29,7 @@ require Exporter; @ISA = qw(Exporter); @EXPORT = qw(Log Logclose); -use FileHandle; +use IO::File; use DXVars; use DXDebug (); use DXUtil; @@ -75,7 +75,7 @@ sub open $mode = 'r' if !$mode; $self->{mode} = $mode; - my $fh = new FileHandle $self->{fn}, $mode, 0666; + my $fh = new IO::File $self->{fn}, $mode, 0666; return undef if !$fh; $fh->autoflush(1) if $mode ne 'r'; # make it autoflushing if writable $self->{fh} = $fh; diff --git a/perl/DXLogPrint.pm b/perl/DXLogPrint.pm index 9c5633e1..3c020357 100644 --- a/perl/DXLogPrint.pm +++ b/perl/DXLogPrint.pm @@ -8,7 +8,7 @@ package DXLog; -use FileHandle; +use IO::File; use DXVars; use DXDebug (); use DXUtil; diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 87129ea0..13af2cc0 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -26,7 +26,8 @@ use DXProtVars; use DXProtout; use DXDebug; use DXLog; -use FileHandle; +use IO::File; +use Fcntl; use Carp; use strict; @@ -330,7 +331,7 @@ sub store if ($ref->{file}) { # a file dbg('msg', "To be stored in $ref->{to}\n"); - my $fh = new FileHandle "$ref->{to}", "w"; + my $fh = new IO::File "$ref->{to}", "w"; if (defined $fh) { my $line; foreach $line (@{$lines}) { @@ -350,7 +351,7 @@ sub store dbg('msg', "To be stored in $fn\n"); # now save the file, overwriting what's there, YES I KNOW OK! (I will change it if it's a problem) - my $fh = new FileHandle "$fn", "w"; + my $fh = new IO::File "$fn", "w"; if (defined $fh) { my $rr = $ref->{rrreq} ? '1' : '0'; my $priv = $ref->{private} ? '1': '0'; @@ -419,7 +420,7 @@ sub read_msg_header my @f; my $size; - $file = new FileHandle; + $file = new IO::File; if (!open($file, $fn)) { print "Error reading $fn $!\n"; return undef; @@ -464,7 +465,7 @@ sub read_msg_body my $fn = filename($msgno); my @out; - $file = new FileHandle; + $file = new IO::File; if (!open($file, $fn)) { print "Error reading $fn $!\n"; return undef; @@ -622,7 +623,7 @@ sub next_transno my $fn = "$msgdir/$name"; my $msgno; - my $fh = new FileHandle; + my $fh = new IO::File; if (sysopen($fh, $fn, O_RDWR|O_CREAT, 0666)) { $fh->autoflush(1); $msgno = $fh->getline; @@ -641,7 +642,7 @@ sub next_transno # initialise the message 'system', read in all the message headers sub init { - my $dir = new FileHandle; + my $dir = new IO::File; my @dir; my $ref; diff --git a/perl/Geomag.pm b/perl/Geomag.pm index d7cdc19c..225cb542 100644 --- a/perl/Geomag.pm +++ b/perl/Geomag.pm @@ -14,7 +14,7 @@ use DXVars; use DXUtil; use DXLog; use Julian; -use FileHandle; +use IO::File; use Carp; use strict; @@ -44,7 +44,7 @@ sub init # write the current data away sub store { - my $fh = new FileHandle; + my $fh = new IO::File; open $fh, "> $param" or confess "can't open $param $!"; print $fh "# Geomagnetic data parameter file last mod:", scalar gmtime, "\n"; print $fh "\$date = $date;\n"; diff --git a/perl/Julian.pm b/perl/Julian.pm index c770e4a9..1316fb42 100644 --- a/perl/Julian.pm +++ b/perl/Julian.pm @@ -8,7 +8,6 @@ package Julian; -use FileHandle; use DXDebug; use Carp; diff --git a/perl/Prefix.pm b/perl/Prefix.pm index 8ea62b87..04dcb4b2 100644 --- a/perl/Prefix.pm +++ b/perl/Prefix.pm @@ -8,6 +8,7 @@ package Prefix; +use IO::File; use Carp; use DXVars; use DB_File; @@ -40,7 +41,7 @@ sub load sub store { my ($k, $l); - my $fh = new FileHandle; + my $fh = new IO::File; my $fn = "$main::data/prefix_data.pl"; confess "Prefix system not started" if !$db; diff --git a/perl/Spot.pm b/perl/Spot.pm index 2e4afe02..7302193a 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -8,7 +8,7 @@ package Spot; -use FileHandle; +use IO::File; use DXVars; use DXDebug; use DXUtil; diff --git a/perl/connect.pl b/perl/connect.pl index 590660fa..fc6110a8 100755 --- a/perl/connect.pl +++ b/perl/connect.pl @@ -38,7 +38,7 @@ BEGIN { use DXVars; use IO::Socket; -use FileHandle; +use IO::File; use Open2; use DXDebug; use POSIX qw(dup); diff --git a/perl/gdx.pl b/perl/gdx.pl index 06b21e94..759af135 100755 --- a/perl/gdx.pl +++ b/perl/gdx.pl @@ -3,7 +3,7 @@ # grep for expressions in various fields of the dx file # -use FileHandle; +use IO::File; use DXUtil; use DXDebug; use Spot; -- 2.43.0