Like a shell script

I have come up with this:


#!/bin/sh

# unless you remove this line, this script runs dry
echo=echo

for newfid in /drive?/fids/_*/*
do
# try not to use external commands for speed
oldfid=${newfid#drive?/fids/_}
oldfid=${oldfid#0}
oldfid=${oldfid#0}
oldfid=${oldfid#0}
oldfid=${oldfid#0}
oldfid=${oldfid#0}
oldfidhi=${oldfid%/*}
oldfidlo=${oldfid#${oldfidhi}/}
oldfid=${newfid%%/*}/fids/${oldfidhi}${oldfidlo}

if test $newfid -nt $oldfid
then
# move the new-scheme fid if it is newer
$echo mv -v $newfid $oldfid
else
# delete it otherwise
$echo rm -vf $newfid
fi
done



However, it does not take care of the effect that mp3tofid uses a different
algorithm to distribute fids across drives than (j)emplode/player. It should
work if you only have one drive, though.

Onother gotcha is that file date comparisons may not work if your player's
idea of the date is off. mp3tofid/rsync stores the file dates of the source
files, while the player uses the current date of the player.

Pim