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

Re^3: Passing file handle to tee that goes into open

by johngg (Canon)
on Nov 10, 2016 at 11:11 UTC ( [id://1175668]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Passing file handle to tee that goes into open
in thread Passing file handle to tee that goes into open

If you have written to an open file handle in a Perl script the file pointer is at the end of the file. If you then append something to that file using an external program the file pointer in the Perl script is not updated and any subsequent writes in the script will overwrite the externally written data. Doing a seek to end of file in the script after the external program has completed should update the file pointer so that subsequent writes by the script continue after the external data.

There may be better ways to write both internal and external data to the same file but I have used this technique without problems.

Cheers,

JohnGG

  • Comment on Re^3: Passing file handle to tee that goes into open

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-23 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found