D
Dan Wilga
I'm seeing odd results when tell() is performed right after open with
append:
#!/usr/bin/perl -w
use strict;
open( FOO, ">foo" ) || die;
print FOO "test";
close FOO;
open( FOO, ">>foo" ) || die;
print "-s: ".(-s "foo")."\n";
print "tell: ".(tell FOO)."\n";
close FOO;
unlink( "foo" ) || die;
Under RedHat 7.1 (perl 5.8.0, glibc-2.2.4-32) I get:
-s: 4
tell: 4
which is what I expect. A Tru64 machine also returns these values.
However, under RedHat 8.0 (perl 5.8.0, glibc-2.3.2-4.80.8) I get:
-s: 4
tell: 0
Perl on the RH 8 system is not the RedHat rpm; it is compiled from
scratch. I get the same (bad) results with RH 9 and glibc-2.3.2-27.9.7.
Since the same version of Perl gives different results, I suspect a
glibc bug. Can anyone confirm this?
Is there a compile-time option that would avoid this?
append:
#!/usr/bin/perl -w
use strict;
open( FOO, ">foo" ) || die;
print FOO "test";
close FOO;
open( FOO, ">>foo" ) || die;
print "-s: ".(-s "foo")."\n";
print "tell: ".(tell FOO)."\n";
close FOO;
unlink( "foo" ) || die;
Under RedHat 7.1 (perl 5.8.0, glibc-2.2.4-32) I get:
-s: 4
tell: 4
which is what I expect. A Tru64 machine also returns these values.
However, under RedHat 8.0 (perl 5.8.0, glibc-2.3.2-4.80.8) I get:
-s: 4
tell: 0
Perl on the RH 8 system is not the RedHat rpm; it is compiled from
scratch. I get the same (bad) results with RH 9 and glibc-2.3.2-27.9.7.
Since the same version of Perl gives different results, I suspect a
glibc bug. Can anyone confirm this?
Is there a compile-time option that would avoid this?