From b3db7c81d8a072f32454612696c367dbcd301529 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 4 Dec 2017 00:23:19 +0000 Subject: [PATCH] optimise listing for inode order svn path=/trunk/; revision=193 --- pages/list.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) -- 2.39.2