This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/doc/Doxygen/tools/find-junkFiles

38 lines
833 B
Text
Raw Permalink Normal View History

#!/usr/bin/perl -w
use strict;
use File::Find ();
# -----------------------------------------------------------------------------
#
# Script
# find-junkFiles
#
# Description
# Search for "junk" files left over from editor, core, CVS, etc.
#
# - print filename only
#
# -----------------------------------------------------------------------------
sub wanted {
return unless -f $_;
if (
m{^\.?.+~$} ## editor backup
or m{^\#.+\#$} ## editor autosave
or m{^\.\#.+$} ## cvs replace update (eg, ".#test.c.1.3")
or m{^core(\.\d+)?$} ## core dump
) {
print "$File::Find::name\n";
}
}
## Traverse desired filesystems
for my $dir (@ARGV) {
no warnings 'File::Find';
warn "(**) checking '$dir' ...\n";
File::Find::find( { wanted => \&wanted }, $dir );
}