Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 992899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:20:15+00:00 2026-05-16T06:20:15+00:00

I have got a file which is let’s say 8 bytes length. For example

  • 0

I have got a file which is let’s say 8 bytes length.
For example it looks like that:

22222222

Now, I read first let’s say 5 bytes and changing them. For ex. to 11111

Finally, I want to write them ONTO EXCISTING DATA to the file, so I expect the file to look like that:

11111222

But I get only 11111, because file is erased. How can I disable erasing? (Maybe this question exists, but couldn`t find question like this one)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:20:15+00:00Added an answer on May 16, 2026 at 6:20 am

    Depending on what you are exactly doing with the file, you might want to memory map it:

    QFile f("The file");
    f.open(QIODevice::ReadWrite);
    uchar *buffer = f.map(0, 5);
    
    // The following line will edit (both read from and write to)
    // the file without clearing it first:
    for (int i=0; i<5; ++i) buffer[i] -= 1;
    
    f.unmap(buffer);
    f.close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 534k
  • Answers 534k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First, events can only be raised from code within the… May 17, 2026 at 12:50 am
  • Editorial Team
    Editorial Team added an answer try this... UIView * v = [[webView subviews] lastObject]; [v… May 17, 2026 at 12:50 am
  • Editorial Team
    Editorial Team added an answer $users = array(); while($row) { if(currentuser) { array_unshift($users,'You') } else… May 17, 2026 at 12:50 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have this bash file, which asks for IP, password, etc. for OpenSSH to
Is it possible to paqckage multiple rpms into one file. I have got two
For example I have this gem called Authlogic-openid, that plugin is outdated, no longer
I have to read a huge xml file which consists of over 3 million
I'm writing an iPhone app which fetches an XML file, parses it and then
I've got a Perl script that groks a bunch of log files looking for
Suppose that you have two huge files (several GB) that you want to concatenate
ok it seems like a simple problem, but i am having problem I have
I have a winapp which writes data into a xml(Data.xml). This xml is my
I have developed a download/upload manager script. When I upload a file via POST

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.