Menu

#53 sysread doesn't warn on read from WRONLY

Development Branch
open
1
2001-11-09
2001-06-27
No

This script should produce a warning, but does not:

#!perl
# pp_sys.c [pp_sysread]
use warnings 'io' ;

my $file = "./xcv" ;
open(F, ">$file") ;
my $a = sysread(F, $a,10) ;
close F ;
unlink $file ;

Note that changing sysread to read generates the appropriate
warning.

Discussion

  • Matthias Neeracher

    • assigned_to: neeri --> pudge
     
  • Matthias Neeracher

    Logged In: YES
    user_id=37219

    I don't get a warning with either operator. Was this introduced post 5.6.0?

     
  • Chris Nandor

    Chris Nandor - 2001-07-02
    • priority: 7 --> 6
    • assigned_to: pudge --> neeri
     
  • Chris Nandor

    Chris Nandor - 2001-07-02

    Logged In: YES
    user_id=3660

    I don't get a warning with either operator in 5.2.0r4, but I do get it with
    read() in my current 5.6.

    If you can't think of anything on this, then assign it back to me again and
    I'll try to figure it out.

     
  • Matthias Neeracher

    Logged In: YES
    user_id=37219

    read() on a O_WRONLY file in GUSI returns 0 (EOF) isntead of an error. Might fix this eventally.

     
  • Chris Nandor

    Chris Nandor - 2001-07-09
    • priority: 6 --> 4
     
  • Chris Nandor

    Chris Nandor - 2001-11-09
    • priority: 4 --> 1
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.