Those are two very vague questions. You should try to do some of this on your own (Scripting Help is about helping you fix your specific issues with your own code).
When you post a thread, make sure that there is only one topic for that thread. If you have multiple unrelated questions (like you do here) you should post two threads.
You should first search for the basic things you want to learn and try writing simple test plugins to test specific parts of code. You can search, on your own, and find many examples of how to do many many things on this website including reading and writing files.
One simple example of reading a file is in the "Bot Apology" plugin in my signature.