S
shyam
Hi All
I had raised a simillar query in an earlier post
http://groups.google.com/group/comp...fstream+write+failure&rnum=1#1d054627402539e1
Basically
I have a file which is opened through ofstream for writing.
Now I want to check if the file has been deleted or not, while being in
the opened state.
I had the notion that if the file is deleted then any subsequent write
on it wil set the fail or bad bit
or raise a failure exception. But this is not the case.
Also I tried all the options suggested in the earlier post but nothing
works.
After getting frustrated I decided to do it the C way using fopen &
fputs etc..
but surprisingly even then I cant detect the file deletion. fputs does
not return any error is I write to a file which is deleted
I would appreciate if anyone can guide me on this.
Can it be done the ofstream way ? and if not then how can we acheive
this?
thanks in advance
I had raised a simillar query in an earlier post
http://groups.google.com/group/comp...fstream+write+failure&rnum=1#1d054627402539e1
Basically
I have a file which is opened through ofstream for writing.
Now I want to check if the file has been deleted or not, while being in
the opened state.
I had the notion that if the file is deleted then any subsequent write
on it wil set the fail or bad bit
or raise a failure exception. But this is not the case.
Also I tried all the options suggested in the earlier post but nothing
works.
After getting frustrated I decided to do it the C way using fopen &
fputs etc..
but surprisingly even then I cant detect the file deletion. fputs does
not return any error is I write to a file which is deleted
I would appreciate if anyone can guide me on this.
Can it be done the ofstream way ? and if not then how can we acheive
this?
thanks in advance