[Tutor] adding more text to a file
steve at alchemy.com
Sun Jan 17 19:34:39 CET 2010
Magnus Kriel wrote:
> It might be that when you create a file for the first time with 'a',
> that it will through an exception. So you will have to try with 'w', and
> if there is an exception, you know the file does not exist and you will
> have to create the file for the first time with 'w'.
That's a little confusing, I think. I think you meant "try with 'a' and
if there is an exception ... create ... with 'w'" but that shouldn't be
necessary anyway. Opening a file with 'a' will append to an existing
file, or create a new file if one doesn't exist already.
More information about the Tutor