Hello jwmac and welcome to the board.

If you take a look around in our UDF forum or on one of the mirror sites you should be able to find plenty examples of methods of detecting sizes and getting the values you want.

Please take a look here.
http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=126821