can i modify a file without load the file in?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: can i modify a file without load the file in?

  1. #1
    Join Date
    Jan 2006
    Posts
    99

    Angry can i modify a file without load the file in?

    hi guys,

    if i have a very large binary file, i only need to modify only value inside, can i do this without loading the file in? how?

    thanks.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,891

    Re: can i modify a file without load the file in?

    Presuming you're replacing a fixed number of bytes at a known byte offset with the same number of bytes, you can simply seek to that location and write over what's there.

    If you want to write a different number of bytes than are present at that location, you'll need to read in at least the part of the file after that, so you can write it out again bumped over to the right place.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center