Saturday, March 8, 2008

Perl program to find files older than ???????????????X' days

In Unix, one can easily list the files that have been modified in the last ???????????????X'?days by using the powerful 'find'command. However, in Windows, there is no such built-in feature exists. One can optionally use 'cygwin'or its equivalent tools but again installing these tools just for this feature might be an overkill in an enterprise environment. One possible solution is to write a small Perl program to achieve this purpose. Perl is widely deployed in many of the enterprises and we can easily leverage the power of Perl to do this.

You can find the sample Perl program here. The program was tested in ActiveState Perl 5.8.x version but it should work okay in Perl 5.x.

FindFiles.zip

Feel free to post your comments, if you would like this program to be written in different language such as vbscript/Perl4, please indicate in your comments.

No comments: