Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: PerlIO, random write file access and O_CREAT (sysopen)

by vsespb (Hermit)
on May 29, 2013 at 15:46 UTC ( #1035873=note: print w/ replies, xml ) Need Help??


in reply to Re: PerlIO, random write file access and O_CREAT (sysopen)
in thread PerlIO, random write file access and O_CREAT

I thought sysopen can't be mixes with print/read, as buffered IO and unbuffered cannot be mixed? And I mentioned that I don't want to use syswrite

Or sysopen is not about unbuffered IO (in opposite to syswrite) ?

(Note that your code still unconditionally truncates the file each time.)
Ok, could you please example why? First file open mode is append, and second is read (read/write)


Comment on Re^2: PerlIO, random write file access and O_CREAT (sysopen)
Re^3: PerlIO, random write file access and O_CREAT (sysopen)
by tye (Cardinal) on May 29, 2013 at 15:58 UTC

    Oh, right, the append prevents the truncate. My mistake.

    sysopen is just a different way of getting a file handle. It has no bearing on whether you use buffered or unbuffered I/O with that handle.

    - tye        

      Ok, thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-07-01 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls