• 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
MemoryMapping Large Files - ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MemoryMapping Large Files - ???


  • Subject: MemoryMapping Large Files - ???
  • From: Christopher Holland <email@hidden>
  • Date: Sat, 12 Jan 2002 05:52:51 -0600

Hello everyone,

I am having a bit of a problem mapping a rather "large" file to an NSData
object. I can map smaller files without problem, but the larger one pukes
with the following error:

-[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]:
absurd length: 1866240000

Of course the length of the file is almost 2 gigs so I realized that it
might
have problems before I got started. OSX is supposed to be able to handle
files larger than 2 gigs, correct?

I'm using the following code:
bigData = [[NSData alloc] initWithContentsOfMappedFile:bigDataPath];

I've tried using 'initWithContentsOfFile' also...just to see if it was the
memory mapping doing it.....no go there.

Should I use the BSD 'mmap' funtion instead of using the 'NSData' methods
above? I'm not coding wizard, but I 've worked with this data and written a
similar program for SGIs. I'm just starting to work on OSX programming and
I'm excited by the possibilities.

Any insight into the mmap problem would be appreciated.

Thanks,

Christopher Holland


Sent using the Entourage X Test Drive.


  • Follow-Ups:
    • Re: MemoryMapping Large Files - ???
      • From: David Rehring <email@hidden>
    • Re: MemoryMapping Large Files - ???
      • From: Jeff Galyan <email@hidden>
    • Re: MemoryMapping Large Files - ???
      • From: Kurt Revis <email@hidden>
  • Prev by Date: Re: Where Does Application Name Come From?
  • Next by Date: Re: Loading a custom view and its subviews from a nib
  • Previous by thread: Re: NSWorkspaceDidTerminateApplicationNotification bug?
  • Next by thread: Re: MemoryMapping Large Files - ???
  • Index(es):
    • Date
    • Thread