in reply to Re: Traverse a directory
in thread Traverse a directory

Thanks for your input.

Well, i was looking for something similar to which gives me output like file command on unix. stat, won't solve my problem.

my issue is more of finding core files which are owned by root, but also if generated by certain application it should be moved to different areas depending on which program has generated it.

Replies are listed 'Best First'.
Re^3: Traverse a directory
by Corion (Patriarch) on Sep 05, 2012 at 12:59 UTC

    Ah - if you want to determine the "file type" (which is always guesswork), there is MMagic and File::MimeInfo.

    Update: Looking at File::MMagic, it doesn't seem to have a magic number for recognizing core dump files. A likely faster way would be to determine the magic number(s) for core dump files on your system (maybe from the file magic file, maybe under /etc somewhere) and then write Perl code that reads just enough data to just (reliably) detect those core dump files.