• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HFS + and creating a big file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HFS + and creating a big file


  • Subject: Re: HFS + and creating a big file
  • From: Chris Page <email@hidden>
  • Date: Tue, 13 Jun 2006 03:07:47 -0700

On Jun 10, 2006, at 16:51 PM, Mike Smith wrote:

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.

--
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 (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: HFS + and creating a big file (From: Mike Smith <email@hidden>)

  • Prev by Date: Re: GCC fubaring register
  • Next by Date: darwinbuild for 10.4.6 PPC
  • Previous by thread: Re: HFS + and creating a big file
  • Next by thread: manual network configuration problem
  • Index(es):
    • Date
    • Thread