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 3664148
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:36:47+00:00 2026-05-19T01:36:47+00:00

OK, this question is actually a follow-up question from my previous one: What would

  • 0

OK, this question is actually a follow-up question from my previous one: What would happen if I abruptly close my script while it's still doing file I/O operations?

So it’s not possible to see an incomplete line written into a file whenever you force your script/program to quit, as the OS will do their job. But what if there’s a power failure, and the OS is just in the middle of appending one line such as “This is a test”(or even bigger strings) into a file, do I get an incomplete line appended or nothing appended or even worse, previous content lost? I’m really curious to know, and this kind of situation would definitely happen on the server side. Anybody can help me out?

  • 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-19T01:36:48+00:00Added an answer on May 19, 2026 at 1:36 am

    Rule 1. There’s no magic. No guarantee. No assurance. Power failure means the circuitry passes through states that are outside their design tolerances. Anything could happen. No guarantees.

    what if there’s a power failure, and the OS is just in the middle of appending … into a file, do I get an incomplete line appended

    Possibly. There’s no magic. The I/O could include two physical blocks. One written, one unwritten.

    or nothing appended

    Possibly. There’s no magic. The I/O buffer may not have been synced to the device.

    or even worse, previous content lost?

    Possibly. There’s no magic. A block write to the device could — during a power failure — fatally corrupt bits on the device.

    I’m really curious to know, and this kind of situation would definitely happen on the server side.

    “Definitely”? Nothing’s definite during an uncontrollable event like a power failure. Anything could happen.

    There’s a really small possibility that the random scrambled bits could be the text of Lincoln’s Gettysburg Address and that’s what appears on the device.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, this is a follow up from a previous question here: C# formatting external
This is related to my previous question , regarding pulling objects from a dmp
This is a follow up to a previous question . if I have multiple
this is a follow up to a previous question i asked. i am having
this is actually a follow up to a question I asked yesterday about problems
This is a follow up question to my previous question . I am trying
This is actually a follow up question to this " Why need to use
Important: This question isn't actually really an ASP.NET question. Anyone who knows anything about
Actually, this question seems to have two parts: How to implement pattern matching? How
Similar to this question ... What are the worst practices you actually found in

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.