maybe this will help
$files = `getFileList -fld ("c:\\yourDir\\")`;
this will list all of the files and folders in the specfied directory
I cant remember how to get the pixel info in, i know it has something to do with a thingy called iffinfo. This will allow you to read in data from .iff files.
https://www.affine.org/bmppack.html that's some info on it there I think
you can download it here
https://www.arcturus.demon.co.uk/ftp/graphics.html
it looks quite old though you may want to look for a better version I just did a searchon google for "iffinfo" and it came up with these and loads more.
Good luck
I'll check back and see how you go with this
Alan
Technical Director - Framestore
Currently working on: Your Highness
IMDB