in reply to Re: Temporary usage of RAM memory
in thread Temporary usage of RAM memory
rename is atomic, but readdir followed by rename isn't. So if the goal is to increment a number encoded into a filename, one has to read the directory to find the file's number, and then rename it. If there's the possibility of two or more invocations of the script working in close time-proximity there's a race condition, and I don't see how the rename approach can eliminate the need for some type of flocking.
It's possible you've thought this through, and I'm missing something simple. If so, I'm open to learning the new trick. ;)
(Or maybe I'm reading too much into your suggestion.)
Dave
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Temporary usage of RAM memory
by fullermd (Priest) on Apr 11, 2014 at 05:16 UTC | |
by davido (Cardinal) on Apr 11, 2014 at 06:18 UTC | |
Re^3: Temporary usage of RAM memory
by thanos1983 (Parson) on Apr 11, 2014 at 08:47 UTC |
In Section
Seekers of Perl Wisdom