z88dk forums

z80 Development Kit

You are not logged in.

#1 2014-01-14 07:08:17

Registered: 2007-07-16
Posts: 1580

Generic random fcntl library

'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:


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

Loading a            .obj

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
Bin  Q:a            .obj:3000:4A7E:3000
Bin  Q:_file        .   :D24E:D26D:2100
Bin  Q:0file        .   :CE63:D24A:2100



Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson