Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: can some elaborate the difference between sysread/read sysseek/seek

by wjw (Deacon)
on Sep 26, 2013 at 19:40 UTC ( #1055885=note: print w/ replies, xml ) Need Help??


in reply to can some elaborate the difference between sysread/read sysseek/seek

Have never used either, but the way I read the docs

sysseek

and

sysread

implies that one
(seek) gets you to a place in the file measured in position units(unicode or bytes) and returns success or not,
and the other (read)
reads from that place for some length in position units(unicode or bytes).

So one gets you to where you want to start, and the other returns scalar data from the start position up to the length you ask for... Hope that is helpful...

  • ...the majority is always wrong, and always the last to know about it...
  • ..by my will, and by will alone.. I set my mind in motion


Comment on Re: can some elaborate the difference between sysread/read sysseek/seek
Re^2: can some elaborate the difference between sysread/read sysseek/seek
by Marshall (Prior) on Sep 27, 2013 at 04:29 UTC
    sysread() is normally used for very low level I/O.
    Normally in Perl, you shouldn't be doing that.
    This is possible, but there are buffering complications.

    read() and seek() are much more normal.
    Do not mix read, seek or sysread and sysseek together.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055885]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2014-09-18 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (105 votes), past polls