Added info while opening a file
Changed all printf's to fprintf's