in reply to Do the File::Stat values Update While a File is Being Written?

File::Stat (or File::stat) are just OO-wrappers around the CORE stat and lstat functions and provide easier access to the results of a regular (l)stat call.

Thus they exhibit the same behaviour of stat or lstat. As these CORE functions rely on what your OS provides, it will depend on your OS whether the data returned by the internal "stat" has any reliable value as long as the file is still being written.

As a bold guess, I would dare to say that none of its values can be fully relied upon until the file being written is "closed".

But why don't you just try it? Write a script that writes (slowly) to a file during a few minutes. Start another script that stats this file repeatedly during this period and reports on the values found.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James