From: paul Date: Mon, 4 Dec 2017 00:23:19 +0000 (+0000) Subject: optimise listing for inode order X-Git-Url: http://git.plutz.net/?p=serve0;a=commitdiff_plain;h=b3db7c81d8a072f32454612696c367dbcd301529 optimise listing for inode order svn path=/trunk/; revision=193 --- diff --git a/pages/list.sh b/pages/list.sh index 07d6d8c..89576f8 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -98,9 +98,13 @@ VIDEOend genlist(){ case "$order" in Date) - find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%T@ %f\n' \ - | sort -r \ - | cut -d\ -f2- \ + find "${_DATA}"/videos/ -maxdepth 1 -mindepth 1 -printf '%i\t%p\n' \ + | sort -n \ + | while read i file; do printf '%s\000' "$file"; done \ + | xargs -0 stat -c '%Y %n' \ + | sort -nr \ + | cut -f2- \ + | sed 's;^.*/;;g;' \ | egrep -i "$file_pattern" ;; Length)