test_iff: Add small tool to test for IFF file structures
useful to see if an IFF file is malformed, but also to see how many frames there is in an animation, etc.
This commit is contained in:
28
tools/test_iff/checkiff.sh
Executable file
28
tools/test_iff/checkiff.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
# set executable
|
||||
PARSEIFF=./parseiff
|
||||
if [ ! -x ${PARSEIFF} ] ; then
|
||||
PARSEIFF="$(dirname $0)/parseiff"
|
||||
fi
|
||||
|
||||
if [ "$1" = "" ] ; then
|
||||
echo "Usage: $0 <file|directory>"
|
||||
echo ""
|
||||
echo "Just run the parser on files. For directories, list files with parsing errors."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "$1" ] ; then
|
||||
find "$1" |
|
||||
while IFS= read line; do
|
||||
if [ -f "$line" ] && file "$line" | grep -q "IFF data" ; then
|
||||
${PARSEIFF} "$line" > /dev/null
|
||||
#if ! ${PARSEIFF} "$line" > /dev/null ; then
|
||||
# echo "error in $line"
|
||||
#fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
${PARSEIFF} $1
|
||||
fi
|
||||
Reference in New Issue
Block a user