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; } } #### 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)