Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine table size on disk

Status
Not open for further replies.

DocBus

IS-IT--Management
May 26, 2005
13
NL
Hi there,

Hope someone can help me. Is there a quick way (ie function) in determining what the is size on a disk of any given table in VFP 9.

I.e. 'c:\tables\table.dbf' size is ....... kb/mb/gb

I need to know this to create overflow tables when my VFP tables max out at their 2GB limit. I couldn't find it easily in the help files.

Thanks for all the help.

Docbus
 
Thanks Mike,

missed the bit where it said Field OR FILE size... Note to self, read better!!! :)
 
you can use header()+reccount()*recsize() or fsize() (depending on the COMPATIBLE ON/OFF setting) or you can use fopen() and fseek() to seek the end of the file or you can use ADIR(). The second element of each row of the generated directory-array contains the filelength.

I'd not take size too close to it's limit. If you have memofields the size of the .fpt file may grow much faster than the .dbf size. If using many indexes, the .cdx file may also exceed the limit faster. With ADIR() you can determine all 3 filesizes at once with a filename mask "tablename.*".

If I'd expect to break the limit anyway, I'd rather define some ID number limit, that makes it easier to deterimine which table you'd need to open to find that record. So you may split each million records or so, depending on the record size, even if you'd still be much lower than 2GB.

Bye, Olaf.
 
Thanks Olaf,

Also very good advice

 
Okay, I'll bite. What's the syntax for using FSIZE() to find file size? It's not in the documentation.
As near as I can tell, the file name parameter is an optional parameter if you're looking for the field size in the non-default table.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
FSIZE(cFieldName) returns the field size with SET COMPATIBLE OFF.

FSIZE(cFileName) returns the file size with SET COMPATIBLE ON.

Regards,
Jim
 

What's the syntax for using FSIZE() to find file size? It's not in the documentation.

It is in mine (VFP 6.0)


Code:
[b]FSIZE( ) Function[/b]
...
Returns the size in bytes of a specified field or file.
...
FSIZE(cFieldName [, nWorkArea | cTableAlias] | cFileName)

So, apparently, if you use file name instead of field name and table alias, you should get the file size.

 
Stella740pl,
I read that part, but what I meant was that there was no example in the documentation. As per usual, the examples are lacking.

The part I didn't read was the SET COMPATIBLE note in the remarks. Thanks Jim for pointing that out.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top