ЭЛЕКТРОННАЯ БИБЛИОТЕКА КОАПП |
Сборники Художественной, Технической, Справочной, Английской, Нормативной, Исторической, и др. литературы. |
3.2.168 syswritesyswrite This function attempts to write $blksize = (stat FROM)[11] || 16384; # preferred block size? while ($len = sysread FROM, $buf, $blksize) { if (!defined $len) { next if $! =~ /^Interrupted/; die "System read error: $!\n"; } $offset = 0; while ($len) { # Handle partial writes. $written = syswrite TO, $buf, $len, $offset; die "System write error: $!\n" unless defined $written; $len -= $written; $offset += $written; } } Do not mix calls to (print or write) and syswrite on the same filehandle unless you are into heavy wizardry. |