|Welcome to the Monastery|
File::stat's size method returns negative valuesby djw (Vicar)
|on May 06, 2003 at 21:08 UTC||Need Help??|
djw has asked for the
wisdom of the Perl Monks concerning the following question:
I have written a small application to collect file/path information recursively from a root path given during execution. I collect this information of each file (using File::stat and File::Find):
I store that information in a mysql database. For some reason it is returning a negative value from File::stat's size method on specific files (test system is win32 and the same files are negative when I run the program again). One of the files is a system file (pagefile.sys), but the rest are simply mpeg's. Each file is over 500MB in size. There are other files collected that record the correct size and are 500MB or greater, so it doesn't seem to be a file size problem. There are also other files in the same directories as the problem files and have properly recorded file sizes. There isn't a permission problem on these files.
Here is a quick snippet:
Then I just iterate over the hash to enter all the data into the database (no modification or calculations etc). Also, there are no errors or warnings during or after execution.
Here is what the data looks like in the db:
I have around 194 K files listed in the files table (from two different systems), and all of these files are from the same system.
Any suggestions on how I should solve this?