You open the same file twice. The open to write will clobber the file, so it's empty when it's read.
Instead, open a new filename to write, and rename it after you're done.
After Compline,
Zaxo
In reply to Re: Removing leading whitespace from a file?
by Zaxo
in thread Removing leading whitespace from a file?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |