speedup to file_list code in /sbin/lunar

Ranitha Mapatuna ranitha at optusnet.com.au
Sun Oct 10 05:49:38 UTC 2004

	The following code for the file_list function in /sbin/lunar produces a
significant speed improvement over the current code. It tested fine at
my end and with hardkrash as well. Credit goes to hardkrash for help
with debugging and implementation.


file_list() {
  flList=`find $1/ -type f -fprintf /tmp/lunar-$$-fl "%f\n" -print`
  file -b $flList | cut -d ' ' -f 1 > /tmp/lunar-$$-ft
  paste -d '\n' /tmp/lunar-$$-fl /tmp/lunar-$$-ft
  rm -f /tmp/lunar-$$-fl /tmp/lunar-$$-ft

More information about the Lunar mailing list