× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Does anyone have a useful definition of stat's st_allocsize? I'm trying to 
handle some file size threshhold issues and I'm not sure if st_size or 
st_alcsize is best.

Example... I have a program calling procedures to create and open a streamfile, 
write lines to it in a loop and close down when st_size exceeds 10K as reported 
by fstat() over the open file descriptor. Works fine. The program is purely a 
testing function to get a clear understanding of stat()/fstat().

But I'm feeling uncomfortable about what's _really_ happening.

When I run the test program specifying a path into the local /root file system, 
the program ends and reports the following values from the stat structure:

  st_size = x'00002732' = 10034 bytes
  st_allocsize = x'00004000' = 16384 bytes(?)
  st_blksize = x'00008000' = 32768 bytes

When I run the same program specifying a path through /QNTC to a Win2000 Server 
system, the values are reported as:

  st_size = x'00002732' = 10034 bytes
  st_allocsize = x'00011000' = 69632 bytes(???)
  st_blksize = x'00001000' = 4096 bytes

(The path is retrieved from a data area so I can run the program easily over 
different file systems.) Okay, st_size and st_blksize seem reasonable in both 
cases. But what in the world is st_allocsize telling me? Is this a reference to 
space that is tied up by this object but not yet used for data? If I want to 
manage by object size, should I be totalling st_allocsize instead of st_size?

Various 'net searches have given little but confusion since st_allocsize seems 
something less than "standard".

Thank you.

Tom Liotta

--
--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertechgroup.com


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp

Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.