Detecting the last directory entry in an ISO9660 filesystem
Posted: Sat Jun 29, 2019 9:43 pm
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?
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?