Generic random fcntl library

Post Reply
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Generic random fcntl library

Post by stefano »

'gendos' is a random file access extension for those computers having primitive memory block load/save functions.
Only two functions must be provided to interface the native block load/save routines by a given filename.
The trick is to add an extra character (0..Z) to the filename to create virtual file blocks; the block size is set to 1K by default but it can be different on every single 'random access file'.
The underscore character is used to create a "control file" keeping the file properties: its size, the size to be set for a single block, etc..
(file splitting/merging tools will be provided)

At the moment I tested this library with S-OS:

Code: Select all

>zcc +sos -create-app -lgendos -lmalloc -DAMALLOC wc.c
sos.exe

#La.obj
Loading a            .obj
#J3000

wc - Count the number of bytes, words,
and lines in one or more files.
#J3000 >file
#J3000 file

Lines   Words   Bytes    File
------- ------- -------  -----------
0000003 0000015 0000072  file
#D
Bin  Q:a            .obj:3000:4A7E:3000
Bin  Q:_file        .   :D24E:D26D:2100
Bin  Q:0file        .   :CE63:D24A:2100
Post Reply