trenchwar has asked for the wisdom of the Perl Monks concerning the following question:
I want to search out all of the jpgs and replace them with a zero byte file.
Somone recommended I open the jpg and close it right away to zero it out, but I wanted to run it by the group as well.
As always thank you!
#!/usr/bin/perl -w use strict; use File::Find; find ( { wanted => \&wanted , }, '/tmp/T1test' ); sub wanted { if( $File::Find::name =~ /\.jpg/i) {print "$_\n"} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Zero out particular file extentions once found
by runrig (Abbot) on Mar 05, 2008 at 00:09 UTC | |
by trenchwar (Beadle) on Mar 05, 2008 at 17:35 UTC | |
|
Re: Zero out particular file extentions once found
by graff (Chancellor) on Mar 05, 2008 at 01:54 UTC | |
by trenchwar (Beadle) on Mar 05, 2008 at 17:30 UTC | |
by graff (Chancellor) on Mar 05, 2008 at 18:20 UTC | |
by trenchwar (Beadle) on Mar 05, 2008 at 18:40 UTC |