Things you are doing wrong:
The last one is the kicker!
In reply to Re: Reading in and writing files by GrandFather in thread Reading in and writing files by Trihedralguy