Windows Delayed Write failed

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2008
Posts: 3
Reputation: nsoni is an unknown quantity at this point 
Solved Threads: 1
nsoni nsoni is offline Offline
Newbie Poster

Windows Delayed Write failed

 
0
  #1
Feb 27th, 2008
Hi Everyone,

I am new user for this community and as a trend when we are in trouble then we remember friends.
Don't mind .

My Question: My application creates trace.txt file which contain debugging information when app. is running but in real production there may be a problem because there trace files are created on another system using MAP drive and if there is a network failure then windows shows an eror dialog box> " Windows Delayed Write failed .... " to create a txt file we are using fprintf().

What i expect after restore a network connection it should work proper but right now i think they have to restart an application which is really BAD.

Can any body help me ?

Thanks
Nishant Soni
ISC Software PVT Ltd.
INDIA
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: Windows Delayed Write failed

 
0
  #2
Feb 27th, 2008
> What i expect after restore a network connection it should work proper
the problem is that the FILE structure that is being passed to fprintf is no longer usable. it contains an operating system file descriptor (handle) which is not valid any more. you really do not need to restart the application. instead you could just close the file and reopen it afresh. (perhaps have a background thread waiting on an event to do this at the right time).
Last edited by vijayan121; Feb 27th, 2008 at 9:13 am.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 3
Reputation: nsoni is an unknown quantity at this point 
Solved Threads: 1
nsoni nsoni is offline Offline
Newbie Poster

Re: Windows Delayed Write failed

 
0
  #3
Feb 27th, 2008
I had same doubt in mind so i check File pointer each time whenit pass to a fprintf() and it is valid
i am checking like
if (TraceFilePinter != 0)
{
fprintf(TraceFilePointer,"Information");
}
is there any other way to test it.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,407
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1467
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Windows Delayed Write failed

 
0
  #4
Feb 27th, 2008
that's the wrong test for this problem. The file pointer is only invalid, very similar to using an unitialized pointer.

>>is there any other way to test it.
Probably check the return value of fprintf(). If it failed then most likely you have the problem you are describing.
The way I got around this was to open the file before each write then close it again after the writes were finished -- this was a logging program.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC