Mailing List Archive

A slightly better version of my previous patch.
I just noticed that the patch I just posted only fixed the "new"
routine and not "new_from_fd". The complete patch that fixes both is below.

sjb.

*** POSIX.pm.orig Wed Aug 2 14:32:35 1995
--- POSIX.pm Tue Aug 29 11:38:55 1995
***************
*** 298,306 ****
POSIX::usage "FileHandle->new(filename, posixmode)" if @_ != 3;
local($class,$filename,$mode) = @_;
local($glob) = &POSIX::gensym;
$mode =~ s/a.*/>>/ ||
$mode =~ s/w.*/>/ ||
! ($mode = '<');
open($glob, "$mode $filename") and
bless \$glob;
}
--- 298,307 ----
POSIX::usage "FileHandle->new(filename, posixmode)" if @_ != 3;
local($class,$filename,$mode) = @_;
local($glob) = &POSIX::gensym;
+ $mode =~ s/\+// && $mode =~ s/^/+/;
$mode =~ s/a.*/>>/ ||
$mode =~ s/w.*/>/ ||
! $mode =~ s/r.*/</;
open($glob, "$mode $filename") and
bless \$glob;
}
***************
*** 309,317 ****
POSIX::usage "FileHandle->new_from_fd(fd,mode)" if @_ != 3;
local($class,$fd,$mode) = @_;
local($glob) = &POSIX::gensym;
$mode =~ s/a.*/>>/ ||
$mode =~ s/w.*/>/ ||
! ($mode = '<');
open($glob, "$mode&=$fd") and
bless \$glob;
}
--- 310,319 ----
POSIX::usage "FileHandle->new_from_fd(fd,mode)" if @_ != 3;
local($class,$fd,$mode) = @_;
local($glob) = &POSIX::gensym;
+ $mode =~ s/\+// && $mode =~ s/^/+/;
$mode =~ s/a.*/>>/ ||
$mode =~ s/w.*/>/ ||
! $mode =~ s/r.*/</;
open($glob, "$mode&=$fd") and
bless \$glob;
}