cheatsheets devlog projects

create-file.md

Creating and Managing Files in UniVerse

2022-11-19 1

These are some notes on creating and managing universe files. The commands below are all in the Pick flavor so they might be different in other flavors.

The below data is for illustration purposes and to roughly set parameters for a new file based on how many records you think it might hold. The best option is to use hash.help and rely on the system telling you what the parameters should be once some data has been added to the file.

Type dictates if a file is a hashed file or not. Type 1 and 19 are not hashed are regular directories.

Modulo is the number of groups in a file. A modulo of 60 means there is 60 groups in the file.

Separation is the buffer size of a group in 512 byte chunks. A separation of 4 means that that the group size is 2048 byte. Creating a file however seems to create a much smaller file so it could be that the file will grow into the size.

The format of the command is: CREATE-FILE {FILENAME} {DICT} {DATA}

CREATE-FILE {FILENAME} {Modulo, Seperation, Type} {Modulo, Seperation, Type}

Below are some testing I did with some records that are relatively large and I think representative of what we handle usually.

Number of Records - DATA section - Most of the keys are alphanumeric

The format is: {Modulo, Separation, Type}

10 - 3,4,3
100 - 59,4,3
1000 - 907,2,11
10000 - 8491,2,18
100000- 63977,4,18

Number of Records - DICT section - Most of the keys are alphanumeric.

10 - 5,2,9
100 - 37,1,6
500 - 79,2,14

Based on this, a possible default that you can copy paste is:

CREATE-FILE {FILENAME} 50,2,6 100,4,18

You should use HASH.HELP against a file afterwards to get the recommended parameters a file should be set at.

HASH.HELP {FILENAME}
RESIZE {FILENAME} {Type} {Modulo} {Seperation}