On Thu, 4 May 2000, Graham; Stephen wrote:

> I am writing an Object Database to run on GNU/Linux and Solaris systems
> for a research project (uni).

Kewl!

> I was wondering if anyone knew of a way to write one section of a file to disk.

Use unbuffered open/read/write/close, not the buffered f* varieties.
Use seek() to locate and then write() to write a block.

> To explain: I am hoping to hold the whole database in one file, and have
> multiple handles open to the file at any one time.  The file will be partitioned
> into Blocks (which are constructs I have defined, currently continuous 64K
> chunks), and I was hoping to be able to flush these blocks to the disk
> individually (for efficiency and ease of implementation)
> I am using the standard FILE * file handles at the moment, and using glibc/g++
> to implement the code.
> 
> Also, does anyone know how many handles you can have to the one file at any
> one time?

This is a dangerous thing to do. Esp with buffered files.
Consider what happens when two different buffered version
of the file are closed asynchronously w.r.t. exach other.


--
Rick Welykochy || Praxis Services


--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to