# 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; substr($szPath, "*") =~ s/\//\\/g; substr($szPath, "*") =~ s/\\\\/\\/g; print "$szPath| is $nPathLength characters| the limit is 255\n"; print OUTPUTFILE "$szPath| is $nPathLength characters| the limit is 255\n"; } if ((length $szFile) > 64) { $nFileNameLength=length $szFile; substr($szPath, "*") =~ s/\//\\/g; substr($szPath, "*") =~ s/\\\\/\\/g; print "$szPath| is $nFileNameLength characters| the limit is 64\n"; print OUTPUTFILE "$szPath| is $nFileNameLength characters| the limit is 64\n"; } } find (\&process_dirs, $szBaseDir); } sub parameters { print "Usage: slfn path logfile\n"; }