Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Openind file for read+append

by Eliya (Vicar)
on Feb 08, 2012 at 18:37 UTC ( [id://952552]=note: print w/replies, xml ) Need Help??


in reply to Openind file for read+append

Opening a file for appending positions the file pointer at the end of the file. If you also want the read its contents, you have to seek to the beginning (or wherever you want to) before reading. (The OS maintains only one file pointer per file handle, not one for reading, and one for writing.)

Replies are listed 'Best First'.
Re^2: Openind file for read+append
by MidLifeXis (Monsignor) on Feb 08, 2012 at 18:40 UTC

    ... and seek to the end before writing again.

    --MidLifeXis

Re^2: Openind file for read+append
by jaldama (Acolyte) on Feb 08, 2012 at 18:46 UTC
    Thanks @eliya , I didn't realize that!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found