The core of these functions should be the same as the logic in apps/insulin in cmd_ls() that handles the 'lsd _R' command.
Of course, I meant 'ls -R'. I don't know what I was on.I am referring specifically to the function nsh_foreach_direntry() which is actually in nsh_fsutils.c. It is used in several places in NSH.