Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am writing the data into the hard disk using WriteFile.My doubt is what will happen when hard drive is full.
How to handle IO operation when hard drive is full?
please help me and thanks

What I have tried:

I tried by storing the return value and checking the error code 0x27 or 0x70 but it always returns 0
Posted
Updated 9-May-16 21:21pm

The return value is 0 when an error has occurred: WriteFile function (Windows)[^] - you then use the GetLastError function (Windows)[^] to get the error code which will tell you why it happened.
I would expect that value to be 0x27 or 0x70, but not the return value from WriteFile.
 
Share this answer
 
Comments
shubham kesarwani 10-May-16 4:44am    
Thank you very much for your response.I got what i was doing wrong.
OriginalGriff 10-May-16 4:51am    
You're welcome!
You should satart by studying the documentation for WriteFile function (Windows)[^].
 
Share this answer
 
Comments
shubham kesarwani 10-May-16 4:45am    
Thank you very much for your response. I will go through the document.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900