/const MAX_SIZE 1024*4*1000 //max file size BLOCK_SIZE 1024*4 REC_SIZE 256 /req_type 0-1 insert record 4-8 read 8-12 write 12-16 reqNum FID RID 0 insert root record 1 RID 01 exc cmd to manage sys 2 insert record 3 remove record 4 r_record 5 r_block 6 r_file 7 8 w_record 9 w_block 10 w_file 11 append_data 12 r_ifile 13 W_ifile 14 a_ifile 15 rm_ifile /rec_type .ext .zz .zls .zli %dtype %u %i %f %c {} obj [dtype%4B|len%4B] table_data zseq u/ usr_record t/ z_thread s/ store z@ tpp zls/zli PID/FID /struct/rec_64bit | 8 | 8 | 8 | 8 | 32 | FID | RID | size | iblock | %int64_t 32 | ctime| mtime | atime | recType| %int64_t 192 | str | %int64_t <> recType 4byte K0 K1 2byte len 1byte 1byte //req_h reqType 4bit reqClass 2bit key_bit field +FID public rec -FID private rec +size size_of_file -size num_of_elm -iblock inode store in file +iblock [1B 1B 6B] - 6B iblock_num to store file - 1B ref file like all relative file vid thumb etc - 1B block_bit block_bit block_size max_file_size 0 00 4 8KB 8MB 1 01 4*8 64KB 64MB 2 10 4*8*8 512KB 512MB 3 11 4*8*8*8 4092KB 4GB data [0|PID| r* | :* ] : str :[] arr :{} obj z_req(req) [ 4 | 4 | 4 | 4 ] [ 4 | 4 | 4 | 4 ] [ 192 ] $rec [FID|RID|size|iblock] [ctime|mtime|atime |recType] [data] [payload] $req [FID|RID|size|iblock] [ctime| |atime |recType] [data] [payload] $res [FID|RID|size|iblock] [ctime|mtime|atime |recType] [data] [payload] [reqType|keyClass|len] [ 1 | 1 | 2 ] $RID { 0:root 1:tpp, 2:public 3-16} 16 reserve $rec_map $block_map {uint64_t d 8K} $blockh_map {FID //--------------------------------------------------- //read public data from server if rec_map[FID]->FID > 0: switch(reqType) :04 ret rec_map[FID] //read record :08 jmp :read_file //read file :12 jmp :read_block //read block //----------------------------------------------------- :verify_req //key class to verify signature switch(keyClass) 0: v_key = (ID < rec_len) ? rec_map[FID]->key : 0; 1: v_key = (ID < rec_len) ? rec_map[RID]->key : 0; 2: v_key = (ID < rec_len) ? rec_map[PID]->key : 0; 3: v_key = req->key //verify req auth than further process if !verify(key signature): ret [ERROR] verify_req fail //--------------------------------------------------- switch(reqType) 01 :exec_cmd //run cmd to manage server 02 :insert_record [sign] [00|len|size][FID|RID] // SN RID des //AL registry use it // 0 0x00 insert public root record // 1 0x01 insert public record // 2 0x02 z@ tpp_record // 3 0x03 t/ tpp_branch_record //----------------------------------------- // 14 0xfe insert private record // 15 0xff insert private root record FID = rec0.len++ now = time() rec = req rec.FID = FID rec.iblock = 0 rec.ctime = now rec.mtime = now rec.atime = now 03 :rm_record //------------------------------------------------------// 04 :r_record [sign][04|len|size][FID] 05 :r_block [sign][05|len|size][FID] iblock = rec_map[FID]->iblock iblock = block_map[iblock][blockNum] block = block_map[iblock] 06 :r_file [sign] [08|len|size][FID] size = rec_map[FID]->num iblock = rec_map[FID]->iblock data = block_map[iblock] //return 0th block if size < 4KB: ret_net data //return whole file loop 1K if idx == 0: return ret_net block_map[idx] //------------------------------------------------------// 08 :w_record 09 :w_block iblock = rec_map[FID]->iblock iblock = block_map[iblock][blockNum] block_map[iblock] = block 10 :w_file [sign] [10|len|size|FID] //append_data if size+data_len > 4MB: ret 'ERROR max file size 4MB' size = rec_map[FID]->size iblock = rec_map[FID]->iblock iblock_arr = block_map[iblock] blockNum = size/4k offset = size%4K iblock = iblock_arr[blockNum] block = block_map[iblock] memcp( block_map, offset, data) :11 append_data [sign] [11|len|size|FID] //append_list_item PID = rec_map[FID]->PID RID = rec_map[FID]->RID size = rec_map[FID]->num iblock = rec_map[FID]->iblock iblock_arr = block_map[iblock] block_0th = block_map[iblock_arr[0]] //meta data block_nth = block_map[iblock_arr[999]] //zli_index //read block where to write size = block_nth[999-num] blockNum = size/4k offset = size%4K block = block_map[iblock_arr[blockNum]] block_nth[999-(num+1)] = size+data_len #wite record memcp(block_map, offset, data) 13 mk_ifile 13 rm_ifile 14 r_ifile 15 w_ifile with open(file_path, 'r') as file: content = file.read() print(content) /req_case ---- /path read file /path<<* write /zpath\n* ---- u/ //z_server base u/+91123456789 //mobile_num base u/xyz@email.com //email base ----- z@ z@/zz z@/zls z@/t/thread ---- s//order.zc/vikas.zm: +9189\0 | member add ecord in .zc file s// ---- zls/:title zli/-:title ---- ytv/:[duration,channelId, vidType, title]; iblock ytc/:title ---- PID/title //that use in case to store lot of records or path break PID/img-2024-05-13 PID/JC-2024-05-03 PID#orderNum ---- +u/xyz/wallet.txt\n public rccord so user read punlic if protect than use clinet side encrapt so other people dont read it -u/xyz/wallet.txt private record PID/wallet.txt\n user whole path not store so it easy to /case len | pak.z@turkishDrama/t/Pyar+Ka+Fasana len | pak.z@turkishDrama/t/Azize+(Urdu+Dub)+|+Hande+Erçel+&+Buğra+Gülsoy+|+Turkish+Drama+2026+|+Aan+TV >zreq pak.z@turkishDrama/t/Pyar+Ka+Fasana << 'Fwz_V8XnF6A; Pyar Ka Fasana | Episode 2 | Turkish Drama | Love And Hate | Seversin | 2 March 2026' /case /reqType [c_zls|FID|str] //create zls file >zreq pak.z@turkishDrama/t/Pyar+Ka+Fasana << 'Fwz_V8XnF6A; Pyar Ka Fasana | Episode 2 | Turkish Drama | Love And Hate | Seversin | 2 March 2026' block_0th iblock_arr 4KB block_1th des 4KB //des block_ thumb 4KB*96 //store thumb block* zls 4KB*900 //store zls item block_nth zls_index 4KB /case /reqType [r | FID | -recNum] //read_record 0th block use as index of record size = rec_map[FID]->size iblock = rec_map[FID]->iblock iblock_arr = block_map[iblock] arr_ids = block_map[iblock_arr[-999]] blockNum = arr_ids[recNum]/4k iblock = blockNum_arr[blockNum] block = block_map[iblock] return block