• 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: [Q] large flat files usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] large flat files usage


  • Subject: Re: [Q] large flat files usage
  • From: Phillip Morelock <email@hidden>
  • Date: Thu, 20 Jun 2002 17:46:25 -0700

On 6/20/02 5:33 PM, "Mike Laster" <email@hidden> wrote:
> You can hide it behind an API like:
>
> - (void) readBuffer:(void *)inBuffer length:(unsigned long) inLength
> fromLocation:(off_t) inLocation;
> - (void) writeBuffer:(void *)inBuffer length:(unsigned long) inLength
> toLocation:(off_t) inLocation;
>
> And implement everything in terms of this API.

Thanks for the voice of experience.

That's kind of where my (admittedly unrefined) instincts were pulling me,
into an offset-indexing scheme. Actually seems like kind of a fun
algorithm...enjoyed your description.

The only thing now that I am having trouble wrapping my head around is
writing in the middle of the file. Say, you insert two rows at (say) lines
3 and 4 in a 20000000 line file...., "pushing" the rest of the file down.

Is this in fact what physically happens? Does the (OS/filesystem) have to
shove everything over to make room, like when you "insert" an element in the
middle of a memory array (where you actually have to copy each of the
remaining elements)? If so, an expensive and seemingly unpractical
operation when it comes to inserting a 50-byte record in a 20Mbyte file. Or
is there something I'm missing conceptually? Sure feels like it!

Cheers
fillup
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: [Q] large flat files usage
      • From: Mike Laster <email@hidden>
    • Re: [Q] large flat files usage
      • From: Martin Reed <email@hidden>
    • Re: [Q] large flat files usage
      • From: Georg Tuparev <email@hidden>
References: 
 >Re: [Q] large flat files usage (From: Mike Laster <email@hidden>)

  • Prev by Date: Re: [Q] large flat files usage
  • Next by Date: Knowing when a CFSocket has died
  • Previous by thread: Re: [Q] large flat files usage
  • Next by thread: Re: [Q] large flat files usage
  • Index(es):
    • Date
    • Thread