ISO9660 Question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Wolf9466
Posts: 12
Joined: Sun Jun 28, 2009 11:17 pm

ISO9660 Question

Post by Wolf9466 »

I was following the tutorial in the wiki, and I just had a quick question. I have read in the root directory, and I take the Location of Extent and Data length values, and I go to it, but how to I scan the root directory for a file name?
StephanvanSchaik
Member
Member
Posts: 127
Joined: Sat Sep 29, 2007 5:43 pm
Location: Amsterdam, The Netherlands

Re: ISO9660 Question

Post by StephanvanSchaik »

Wolf9466 wrote:I was following the tutorial in the wiki, and I just had a quick question. I have read in the root directory, and I take the Location of Extent and Data length values, and I go to it, but how to I scan the root directory for a file name?
When the root directory is loaded you have to search for the directory/file entries. The first one is at the start of the root directory block, and all others follow that extent directly with a potential gap. Offset 0 (in bytes) of a directory entry represents the size of that entry. Offset 32 (in bytes) represents the size occupied by the filename following at offset 33. The next directory entry can be found by using the number located at offset 0 as it should be added to the offset of the root directory extent. There's one thing I haven't explained yet and that is the potential gap. This gap exists when your root directory is bigger than 2kB. Normally each logical block on a CD-ROM is 2048 bytes. In case the root directory uses two or more blocks, there might be a gap at the end of each block. This is simply due the fact that directory entries are never split up and that they should be located in the next block if they won't fit in the current block.


Regards,
Stephan J.R. van Schaik.
Wolf9466
Posts: 12
Joined: Sun Jun 28, 2009 11:17 pm

Re: ISO9660 Question

Post by Wolf9466 »

So, say I have the root directory structure read in, how would I find a file by name that is in the root directory?
(I'm sorry, I didn't really understand your post well, could you post a snippet of code, maybe?)
Post Reply