[simple Perl-script] # check if filenames are longer then 64 characters # and if filename+path are longer then 255 characters # as this makes resetting permissions or copying # files a nightmare use File::Basename; $szFolder=shift @ARGV; $szLogFile=shift @ARGV; if ($szFolder eq "") { parameters(); } else { if ($szLogFile eq "") { parameters(); } else { # open logfile open(OUTPUTFILE,">$szLogFile") || die; listfiles($szFolder); close(OUTPUTFILE); } } sub listfiles { local $szBaseDir=$_[0]; use File::Find; sub process_dirs { $szPath=$File::Find::name; $szFile=basename($szPath); print "Checking: $szFile\n"; if ((length $szPath) > 255) { $nPathLength=length $szPath; print "Full pathname $szPath is $nPathLength characters, which exceeds limit of 255 characters\n"; print OUTPUTFILE "Full pathname $szPath is $nPathLength characters, which exceeds limit of 255 characters\n"; } if ((length $szFile) > 64) { $nFileNameLength=length $szFile; print "File $szPath is $nFileNameLength characters, which exceeds filename limit of 64 characters\n"; print OUTPUTFILE "File $szPath is $nFileNameLength characters, which exceeds filename limit of 64 characters\n"; } } find (\&process_dirs, $szBaseDir); } sub parameters { print "Usage: Check-files-and-paths.pl path logfile\n"; } [end of Perl-script]