Is anyone preallocating file space on XSan?
I'm trying to work out how from the XSan programming guide...
It's very simple... for POSIX apps, you can use the standard
F_PREALLOCATE fnctl... or for Carbon apps, you can use FSAllocateFork
(). For Cocoa apps, using F_PREALLOCATE is probably easiest, just
use NSFileHandle to open the file for writing, use the -(int)
fileDescriptor method to get the file descriptor, use that with
F_PREALLOCATE, and then write out your file contents using -(void)
writeData:
Note that any space pre-allocated using standard Mac OS X APIs (i.e.
the ones I have just described) will be truncated back to the real
end of file (the last byte written to the file, i.e. the value
reported in the st_size field of struct stat) when the file is
closed. This is the same behavior that preallocation on HFS+ has.
-- thorpej
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xsan-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xsan-users/email@hidden