From: paul Date: Fri, 16 Jan 2015 18:29:51 +0000 (+0000) Subject: speed up name ordered file listing by using find instead of ls (this omits unessecary... X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=96db9d27f5e84af54f078ee02180df1460e6d16d;p=serve0 speed up name ordered file listing by using find instead of ls (this omits unessecary stat'ing) svn path=/trunk/; revision=31 --- diff --git a/pages/videoview.sh b/pages/videoview.sh index e90c951..0787796 100755 --- a/pages/videoview.sh +++ b/pages/videoview.sh @@ -116,7 +116,7 @@ VIDEOend fi } -_by_name(){ ls ${_DATA}/videos/ |egrep -i "$file_pattern" } +_by_name(){ find ${_DATA}/videos/ -mindepth 1 -maxdepth 1 -printf '%f\n' |sort |egrep -i "$file_pattern" } _by_date(){ ls -c ${_DATA}/videos/ |egrep -i "$file_pattern" } _by_length(){ ls ${_DATA}/by_length/ |sed -r 's:[0-9]{5} - ::g' }