quote:Original post by Ziphnor
Well, there could be other reasons for the failure to open the file, and i would like to be able to differentiate between failure because it didnt exists and failure for other reasons(ie, "real" error).
Like all streams (at least all that I know of), fstreams have methods like bad() and fail() to check for read/write errors.
quote:
The other reason i just dont try to open it, is that the most open file methods seems create the file if it doesnt exist(and then i would have to check file size to see if it had been created previously).
But the ifstream idea seems good, i guess the ifstream open method wouldnt create the file(that would be kind of silly, wouldnt it?)
You''re right. If you try to open a non-exsistent file with ifstream, it will not create the file.
/*=========================================*/
/* Chem0sh */
/* Lead Software Engineer & Tech Support */
/* http://www.eFaces.biz */
/*=========================================*/