ανάγνωση#

Read up to $nbytes bytes from $fd into $buffer.

Σύνοψη#

use POSIX qw(read);
my $buf = "";
my $n = read($fd, $buf, 4096);

Τι επιστρέφεται#

On success, the number of bytes read (or "0 but true" for EOF); on failure, undef (with $! set). The data is written into $buffer in place - truncated or grown to match the actual read length.

Οριακές περιπτώσεις#

  • Partial reads are normal on pipes, sockets, and terminals; always check the return length.

Διαφορές από το upstream#

Fully compatible with upstream POSIX.