Thnx dwise1 aol .... solved both the probs... though the second one was quite irritating... i created a new .c file copied the code and it works fine... previously, i had checked using "errno." the file opens ,writes data onto it .. without a hitch but crashes when it is about to read it... Now even that is solved.. Had the same problem last time too.. Thnx for ur help.. :D