Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RaSQL/B 6.1a for Clipper - <b>n_xsetalloc()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_XSETALLOC()
Preallocate disk space for a file

Syntax
N_XSETALLOC([<nPages>])

Argument
<nPages> is the number of pages (up to 65535) to allocate.

Returns
N_XSETALLOC() with no arguments returns the number of pages currently 
allocated.

Remarks
Btrieve allows you to preallocate space for files. This can improve 
performance in two ways.

1.   When adding records, Btrieve will not need to request more space from 
     DOS.

2.   Since the entire file occupies contiguous space on the disk, when the 
     disk head reads or writes it will move a shorter distance, on average, 
     than it would if the file were noncontiguous.

Use N_XPAGESIZE() to specify the size of the page.

Preallocation is the norm in mainframe databases.

Example
* Allocate space for a file of 1024
* pages of 2048 bytes each (2097152 bytes)
N_XPAGESIZE(2048)
N_XSETALLOC(1024)


See Also: N_XAMAKETBL() N_XMAKETBL() N_XPAGEMAX() N_XPAGESIZE() N_XSETFLAGS()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson