Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #w zadanym drzewie katalogow usunac (wyswietlic) pliki regularne, znajd.
- #sie w katalogach do ktorych mamy prawo zapisu i ktorych rozmiar w kB > od dlugosci nazwy
- use warnings;
- use strict;
- use File::Find;
- use File::Basename;
- my $directory = $ARGV[0];
- -d $directory or die "Argument isn't a directory";
- find(\&wanted, $directory);
- sub wanted{
- if (-f $_){
- my $filename = $File::Find::name;
- my $filesize = (-s $_)/1024;
- my $file_len = length($_);
- if ($filesize < $file_len && $filename =~ s/6/6/g ne 3) {
- print("File: $filename\n");
- print("Size: $filesize kB\n\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement