site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jun 10, 2006, at 16:51 PM, Mike Smith wrote: -- Chris Page - Computer Professional The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. -- Nathaniel Borenstein _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... If you don't need the file when you are closing it, first truncate it to zero size, then close and delete. Or, just delete it and then close it. (Requires using Unix file APIs, of course. You can't delete an open file using File Manager.) When you're initializing a large file, I recommend you incrementally initialize the file with progress UI. You can do this by setting the file size and then writing zeros, say, 1MB at a time. Another method I've seen is to incrementally resize the file; you increase the file size by 1MB, then close it, then open it again and increase it another 1MB, and so on. This may be more efficient because the OS handles writing the zeros for you, but I haven't timed it--it could be slower to open and close the file repeatedly. It sure would be nice if the OS could do this asynchronously. Instead of making the process closing the file wait on the initialization, make opens wait--or better yet, stop writing zeros to the file and treat it as though it had just been opened and resized. This email sent to site_archiver@lists.apple.com