Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

help with SEEK, TELL, READ, others

by Kozz (Friar)
on Jun 29, 2000 at 04:55 UTC ( [id://20308]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open(FH, "+< filename.txt") || die "$!";  #open the file for read/writ
    +e
    flock(FH, LOCK_EX);        # get an exclusive lock
    ...
    print FH $scalar;          # print at beginning of file, clobbering ol
    +d data
    truncate(FH, tell(FH));    # truncate any data beyond where we've writ
    +ten (is this correct as well?)
    close(FH);                 # close the file
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2024-04-24 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found