Advertisement
AyrA

A new Compression Format

Aug 21st, 2012
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;This is a Header File to a Splitted Tar.
  2. ;A Header File Always maches the Archive Name.
  3. ;Naming Convention is:
  4. ;Archive: <name>.sta
  5. ;Header:  <name>.ini
  6.  
  7. ;sta means seperated Tar archive.
  8. ;ini means initialisation File.
  9.  
  10. ;Warning! THIS FILE IS NOT A VALID INI FILE.
  11. ;The .ini Extension is used, because it allows Editing with a double Click
  12.  
  13. ;There are some benefits in using this Format instead of a tar:
  14. ;1. Seperated Header. Supports Text Editing of the File Header because it is in Text only format.
  15. ;   You do not need a Tool so see its contents. The Archive itself only contains the Files in an unmodified Format.
  16. ;   Allows reorganizing of Directory Structures and renaming Files without rewriting the binary File itself.
  17. ;   Allows the archive to be put in a Compressed .gz File. The Header is left outside and still readable.
  18. ;2. Supports Efficient Store. If you use the same File multiple Times, it only has to be stored once.
  19. ;3. Can hide Contents by removing the specified entries (or Parts) in the Heading. This allows the sharing of a single
  20. ;   Archive with different Header Files if the Content is not sensitive.
  21. ;4. Supports Fragmentation. This allows File editing and appending at any Time without reorganizing the Archive itself.
  22. ;   Fragmentation makes it impossible to restore Binary Files from an Archive without the Header File if done correctly.
  23. ;   It allows Part sharing between Files and even overlapping of Parts withhin the same File!
  24. ;5. Supports splitting. If the File is splitted it does not changes any Byte in its contents.
  25. ;   The Heading is always in a seperate File and you no longer need to "index" all Parts when opeing the File.
  26. ;6. Supports shared File Parts. Multiple Files can share the same Fragments, increasing
  27. ;   Efficiency in storing. This also can make it impossible to grab Contents out of an Archive.
  28. ;   If the Magic Number is shared between adjacent Files, it is impossible to find out, where one File ends and another
  29. ;   starts. Magic Number: Part of File, that identifies its Contents, often at the Beginning of a File
  30. ;7. The Archive itself has no header and therefore can be hidden in any other File, for example an MP3 File.
  31. ;   If a File contains all Byte Values you need you can "generate" entire archives just by writing a Header File
  32. ;   for it.
  33.  
  34. ;Info Section of an Archive. The complete Section is optional.
  35. ;Default Fields are: Name,Desc,Creator,Website
  36. ;Custom Fields can be added. An Extractor or Info Tool should show them too.
  37. [INFO]
  38. Name:Slot Machine Game Demo
  39. Desc:This is a simple Demo of my first Game written in C#. It is a Slot Machine.
  40. Creator:AyrA
  41. Website:https://ayra.ch
  42. Important:This is only a Demo. You cannot save your progress at the moment.
  43.  
  44. ;A Collection of relative Directories
  45. ;Index 0 is reserved for the Root Folder (Folder where extraction starts, not Root of Disk)
  46. ;If only the Root Folder is required, this Section doesn't needs to be included.
  47. ;Directories are created before Files are, it does not matters, which Section comes first.
  48. ;Directories are always created, even if no File refers to it. This allows Creation of empty Directories.
  49.  
  50. ;Format: <INDEX>:<PARENT>:<DIRECTORY>
  51. ;<INDEX>     -> Minimum: 1 Maximum: 2147483647 (32 Bit signed Integer Max),
  52. ;               must be unique in the [DIR] Section. Gaps between Indexes are allowed.
  53. ;               Directories are created from top to Bottom in this File and not in Index Order!
  54. ;               If you try using more Directories than the Index space allows i will stab you.
  55. ;<PARENT>    -> Parent Directory Index. Use 0 for Root Folder
  56. ;<DIRECTORY> -> Directory path to create. You have to create every single dir in the Path
  57. [DIR]
  58. 1:0:docs
  59. 2:0:bin
  60.  
  61. ;A Collection of Files.
  62. ;processed from top to bottom.
  63. ;Values are splitted with a ":" char.
  64. ;Multiple Values of the same Type (multiple starts, lengths or dirs) with ";"
  65.  
  66. ;Format: <FILENAME>:<DIR>[;DIR[;...]]:<START>[;START[;...]]:<LENGTH>[;LENGTH[;...]]
  67.  
  68. ;<FILENAME> -> Name of the File (test.txt)
  69. ;<DIR>      -> ID of target Directory. multiple IDs allowed (1;4;2)
  70. ;<START>    -> Index in the Archive (from File start), where the File starts. Multiple Indexes allowed (10;30;15)
  71. ;              Indexes are accessed in the Order they appear. First byte in the Archive has Index 0
  72. ;<LENGTH>   -> Length of each Index. for each <START> Value, there must be an <LENGTH> Value.
  73. [FILES]
  74. TEST.TXT:1;2:20;0:20;30
  75.  
  76. ;Explaining the Values:
  77. ;TEST.TXT -> This is the name of the File(s) being created.
  78. ;1;2      -> The File is put in Directory 1 AND 2
  79. ;20;0     -> First Part of the File starts at 20, second at the beginning (0), this is an Example of Fragmentation
  80. ;20;30    -> First Part is 20 Bytes long, the second part 30, this is a nice Example of Part sharing/overlapping.
  81. ;            The First part, starts at offset 20 and is 20 Bytes long. The Second Part starts at Offset 0 (Beginning of File)
  82. ;            and is 30 Bytes long, so it overlaps with the previous Part (10 Bytes), so the Bytes 20 to 30 are read
  83. ;            twice from the archive.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement