New archive file format (was: [omgps] collect feature requests)

Jose Luis Perez Diez perezdiez at gmail.com
Thu Jul 2 12:56:46 CEST 2009


El Wednesday, 1 de July de 2009 23:20:40 Laszlo KREKACS va escriure:
> ## General properties
> - blocksize: 512 bytes
> - only store filename (and directory if any) and content
> - first file contains the filenames
> - header: start block, end block, position of last block
>
> ## Overall file structure
> [header][filenames][1. file][2. file][3. file]
>
> ## [header]
> [SB][EB][POS] [SB][EB][POS] [SB][EB][POS] etc..

My first reaction to this was: Why do you need this?

My points are:

1- With this format the resulting archive is near read only (every few inserts 
 need the whole file should be rewrote.
 One could use a loop mounted filesystem and use well tested tools.

2- To make it usefull with every app I think we need to mount it with fuse.

3- Not enogh metadata.

I think it could be simpler that way

Metadata Block [0..511]
  [0..3] Previus # metadata block (last block for fist metadata block)
  [4..7] Next    #Metadata Block (First on last metadata block
  [8..]  Metadata_items   #list of  Metadata_item
           
Metadata_item
   [0..1] Metadata_size #Bytes;
   [2] Kind # of metadata (Name, Block,Size, Date,CRC, ...)
   [3..6] file Id 
   [8..Metadata_size-1] Value;

Block Value 
 [0..3] Start Block
 [4..7] End Block

The example on QA soud could have the folowing metadata be:

  00 00 00 00 # Previous 
  00 00 00 00 # Next 
  00 1F 01 00 00 00 01 "first filename.extension" #31 Bytes Name id 1
  00 11 01 00 00 00 02 "second try" # 17 Bytes Name id 2
  00 1D 01 00 00 00 03 "I want a sexy name.txt" #29 Bytes Name id 4
  00 0F 02 00 00 00 01 00 00 00 01 00 00 00 02 # id 1 blocks 1-2
  00 0F 02 00 00 00 02 00 00 00 03 00 00 00 04 # id 2 blocks 3-4
  00 0F 02 00 00 00 03 00 00 00 05 00 00 00 08 # id 3 blocks 5-8
  00 0B 03 00 00 00 01 00 00 03 00 #id 1 768 bytes
  00 0B 03 00 00 00 02 00 00 04 00 #id 2 1024 bytes
  00 0B 03 00 00 00 03 00 00 07 FF #id 3 2047 bytes
  00 00 #end of metadata

And a total file size of 9 blocks or 4608 bytes but with the same disk usage 
of 8kb.



More information about the community mailing list