Welcome, Guest. Please login or register.

Author Topic: Creating a new file format (need suggestions)  (Read 1079 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show all replies
    • http://www.robthenerd.com
Re: Creating a new file format (need suggestions)
« on: May 04, 2005, 05:28:49 PM »
Hmmm... Would it not make sense then to have something recursive like a filesystem-type-thing in the file format? A header which points at offset "index" blocks, and each of these index blocks can contain offsets to data or further index blocks. Each index block having an identifier field which would correspond to one of the lists you were trying to save. It's not something I've ever done myself, but if I was to try, that's the approach I'd take...
Engineers do it with precision
--
http://www.robthenerd.com
 

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show all replies
    • http://www.robthenerd.com
Re: Creating a new file format (need suggestions)
« Reply #1 on: May 08, 2005, 07:28:16 PM »
@Jose

Well, indexes are either referenced from the top of the file, or from the parent index, so the speed issue won't really come into play until you've got hundreds of layers, as your indexes can use offsets to the child indexes or to the data, so a list, say, 4 layers deep, will involve only 4 jumps to definite locations. I suppose the indexes could be put at the start of the file for speed provided they are worked out in memory beforehand. If they can't be calculated before saving they could in theory be put at the end of the file, but then you have the problem that all the data is useless if the file is truncated...

Anyway, still just suggestions, and as you develop I'm sure changes can be made to better suit the situation.
Engineers do it with precision
--
http://www.robthenerd.com