djw has asked for the wisdom of the Perl Monks concerning the following question:
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.use File::stat qw(:FIELDS ); use File::Find qw( finddepth ); # stuff... finddepth \&gatherData, $dir; # stuff... sub gatherData { if (-f) { stat($_); # ----------- # get the current directory # and file names my $cdir = $File::Find::dir; my $file = $_; # ----------- # put that into our data # hash for input later $data{$cdir}{$file}{size} = $st_size; $data{$cdir}{$file}{ctime} = $st_ctime; $data{$cdir}{$file}{mtime} = $st_mtime; $data{$cdir}{$file}{atime} = $st_atime; } }
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.mysql> select file_id, file, size from files where size < 0; +---------+--------------+-------------+ | file_id | file | size | +---------+--------------+-------------+ | 635609 | fooo 3.mpg | -773913892 | | 635608 | baaar 1.mpg | -529282490 | | 635603 | foooo 3.mpg | -2035912248 | | 611851 | pagefile.sys | -2147483648 | +---------+--------------+-------------+ 4 rows in set (0.32 sec)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: File::stat's size method returns negative values
by vladb (Vicar) on May 06, 2003 at 21:19 UTC | |
by djw (Vicar) on May 06, 2003 at 21:32 UTC | |
by leriksen (Curate) on May 07, 2003 at 00:55 UTC | |
Re: File::stat's size method returns negative values
by BrowserUk (Pope) on May 07, 2003 at 03:34 UTC | |
Re: File::stat's size method returns negative values
by PodMaster (Abbot) on May 07, 2003 at 08:56 UTC | |
by djw (Vicar) on May 07, 2003 at 14:14 UTC | |
Re: File::stat's size method returns negative values
by djw (Vicar) on May 07, 2003 at 21:46 UTC |