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

  • Home
  • SEARCH
  • 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 4619064
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:22:24+00:00 2026-05-22T02:22:24+00:00

I have a C application. Which creates a connection to file at startup and

  • 0

I have a C application. Which creates a connection to file at startup and it continuously runs for many days.

I am only connecting one time . and not reconnecting it in code.
Only checking if

if(NULL == file)

Is there can be case that my application lose I/O connection of that file handler ?

if yes. Is there a way , How can I create test case for it ?

  • 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-22T02:22:25+00:00Added an answer on May 22, 2026 at 2:22 am

    Yes it’s possible. For example if the file is on another machine or on a removable storage. Then you can physically disconnect/unplug the device and the subsequent operations on the handle will fail.

    As others mentioned in the comments, you can simulate it in a test case by creating a RAM disk and either unmounting it or killing the driver. Alternatively, if all you care is about unidirectional I/O, maybe you could test your code with a pipe, and then close the other end of the pipe.

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

Sidebar

Related Questions

I have a VB application which extracts data and creates 3 CSV files (a.csv,
I have created a small application which opens,reads and creates Excel files. The app
I have created the application in which I need to configure the connection pool.In
I have an application which has to live as a service, I create an
I have created an application which needs 'hand-over' to the support group in the
I have an AJAX application which has used CSS divs to create panels on
I want to create an application which will have a client and server components.
I'm developing an application which currently have hundreds of objects created. Is it possible
I have created a Web Application in asp.net 2.0. which is working fine on
I want to globalize my application. I have created a small form which asks

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.