im having some difficulties with fstream and giving some specific error messages:

say for instance i have:

ifstream in;

i need two error messages
1) to test if the file doesnt exist, print 'file does not exist'
2) if the file exist, but unable to be access (perhaps in read only mode)

ive been trying to work with in.fail() for if the file does not exist, but it also seems to work for #2.......is there any other ways of getting these two error messages?