mmap

This is a discussion on mmap within the C Programming forums, part of the General Programming Boards category; Hi, I need to mmap a file so that I can grow and shrink it as needed. In addition to ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    mmap

    Hi,

    I need to mmap a file so that I can grow and shrink it as needed. In addition to using mremap, the actual file size needs to be modified as well. I do not know how to change the file size, but i've been told to seek past the end of the file. Does any know how to solve this problem?

    I open the file with open function.

    Thanks for any help.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    For some things, I guess you have to use the fd you got when you opened the file in the first place.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. mmap program
    By karthigayan in forum C Programming
    Replies: 1
    Last Post: 04-01-2009, 04:38 AM
  2. BSD mmap for shared memory - am I right?
    By sean in forum Linux Programming
    Replies: 21
    Last Post: 03-09-2009, 01:57 PM
  3. using mmap for copying large files
    By rohan_ak1 in forum C Programming
    Replies: 6
    Last Post: 05-13-2008, 08:12 AM
  4. write a word to file by using lseek and mmap
    By SoFarAway in forum C Programming
    Replies: 1
    Last Post: 03-28-2005, 12:33 PM
  5. mmap() function - Linux
    By mattbrrtt in forum Linux Programming
    Replies: 0
    Last Post: 08-09-2003, 07:04 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21