I'd like to rewrite these 2 commands so they will use only POSIX-compliant switches:
find "$TARGET_DIR" -maxdepth 1 -type d -printf '(DIR) %f\n'
find "$TARGET_DIR" -maxdepth 1 -type f -printf '%s %f ' -exec file -b {} \;
-maxdepth 1 can probably be replaced with -prune, but -printf will require a more complicated redirection.