in reply to Reading in and writing files

if you are using the "standard" .htaccess apache files, then they're not plain text, and are maintained by using htpasswd utility
the hardest line to type correctly is: stty erase ^H