Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Bareword "SEEK_END" not allowed while "strict subs" in use (truncate)

by thanos1983 (Parson)
on May 09, 2014 at 15:30 UTC ( [id://1085593]=note: print w/replies, xml ) Need Help??


in reply to Re: Bareword "SEEK_END" not allowed while "strict subs" in use (truncate)
in thread Bareword "SEEK_END" not allowed while "strict subs" in use

To: tye,

Ok, starting to make more sense.

My plan was to use flock() to lock the file while my process will be either reading or writting to it. I want to avoid 2 processes together reading and writting simultaneously which will result on overlaping.

So my plan was to lock the file seek to the end of the file so I can write the next part of my output, close the file and allow the next process to write on it.

I was under the impression that I have to use truncate to empty the rest of the file at the end, to make sure there is nothing left besfore start writting.

I got this idea from the tutorial File Locking where they use both:

seek(MYFILE, 0, 0); truncate(MYFILE, 0);

This is my part of confusion.

  • Comment on Re^2: Bareword "SEEK_END" not allowed while "strict subs" in use (truncate)
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-19 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found