getFiles: use NULL as separator

This commit is contained in:
Vincent Riquer 2025-10-11 21:55:16 +02:00
parent 800525d90b
commit e335d42156

View File

@ -8,7 +8,7 @@ getFiles() {
(( cron )) || echo -n "Scanning $sourcepath... " (( cron )) || echo -n "Scanning $sourcepath... "
# We probably have thousands of files, don't waste time on disk writes # We probably have thousands of files, don't waste time on disk writes
echo 'BEGIN TRANSACTION;' >&3 echo 'BEGIN TRANSACTION;' >&3
while read time size filename while read -d $'\0' time size filename
do do
if (( skip_us_timestamp )) if (( skip_us_timestamp ))
then then
@ -63,7 +63,7 @@ getFiles() {
fi fi
progressSpin progressSpin
done < <( done < <(
find "$sourcepath" "${prunes[@]}" -type f -not -name '.*' -printf "%T@ %s %P\n" find "$sourcepath" "${prunes[@]}" -type f -not -name '.*' -printf "%T@ %s %P\0"
) )
echo 'COMMIT;' >&3 echo 'COMMIT;' >&3
(( cron )) || echo -n $'\r' (( cron )) || echo -n $'\r'