[Tutor] creating files on open()
Kristian Zoerhoff
kristian.zoerhoff at gmail.com
Fri May 20 21:34:08 CEST 2005
On 5/20/05, William O'Higgins <william.ohiggins at utoronto.ca> wrote:
>
> Fascinating. I was opening the file read-write (r+) and it didn't work.
> Are there only the few file-access methods (read (r), write (w), append
> (a) and read-write (r+))? Sometimes I like to prepend or to clobber or
> to address in binary mode - are these things possible, or do I have to
> seek() to prepend and delete to clobber? Thanks.
If you're intending to clobber, I'd open in write binary (wb) mode. I
don't think I've ever used r+, as using w or wb should still give you
read-write access.
--
Kristian
kristian.zoerhoff(AT)gmail.com
zoerhoff(AT)freeshell.org
More information about the Tutor
mailing list