OSDev.org
https://forum.osdev.org/

Detecting the last directory entry in an ISO9660 filesystem
https://forum.osdev.org/viewtopic.php?f=1&t=33751
Page 1 of 1

Author:  Twicetimes [ Sat Jun 29, 2019 9:43 pm ]
Post subject:  Detecting the last directory entry in an ISO9660 filesystem

Based on all the ISO9660 documentation I've found, I'm operating under the following assumptions:

1) Directory entries cannot be larger than 255 bytes
2) Directory entries always end in the same logical block as the one in which they started

To detect when you've hit the last entry for a directory, it seems to be a case of checking that the first byte following the end of the previous entry has a value of zero (the 'Length of Directory entry' field).

Due to assumption #2 above however, it seems to me that if you're less than 255 bytes from the end of the current block, there might just be zero-padding to the end of this block, and then more directory entries in the next block. However, I haven't found that confirmed in so many words anywhere. Is this how it works? Is there a scenario where checking the start of the next logical block would be reading unrelated data?

Author:  Twicetimes [ Tue Jul 02, 2019 10:13 pm ]
Post subject:  Re: Detecting the last directory entry in an ISO9660 filesys

Finally realised what the answer to this is. The first directory entry describes itself, so I can look at the data length field and divide by the logical block size to know how many blocks are used for all the directory's entries combined.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/