Hello there.

I've been struggling with this for a week and I haven't worked it out yet. What I mean is my own archive file format. It's not that hard if you just want to store files without directories - I've done it once before. Now I'd like to extend its possibilities and add directories support.

My question is - what's the best way of implementing them? I mean, I can easily make appropiate structures in Pascal and save them to a stream as a tree. But I have no idea how to properly calculate offsets. Any ideas?

Or maybe you can put me on the right track and propose me another solution?

I'd appreciate any ideas, replies.