'''[http://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/fileutil/traverse.html%|%fileutil::traverse]''', a [tcllib] module, provides utilities for traversing directory hierarchies. ** Description ** [hv]: While traversing down a directory, there are times when you encounter one that is not accessible. While the documentation stated that the package will ignore those directories by default. In reality, my sample script crashed. Curious, I dug into the source code and found what might be a bug. I posted the problem and a work-around solution on http://stackoverflow.com/questions/17633681/how-to-handle-permission-denied-when-using-fileutiltraverse%|%StackOverflow%|% To sum up, I used the `-prefilter` option to determine if a directory is readbale: ====== package require fileutil::traverse proc isAccessible {absPath} { return [file readable $absPath] } # Main set searchDir /tmp fileutil::traverse t $searchDir -prefilter isAccessible puts "\nFiles in $searchDir:" t foreach fileName { puts $fileName } ====== <> Package | Tcllib | File