Welcome, Guest. Please login or register.

Author Topic: Adding to a growing file in the filesystem with C...  (Read 2450 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Adding to a growing file in the filesystem with C...
« on: April 14, 2005, 09:19:00 PM »
@Thomas

Nonsense. Cymric is right.

From dos/Open autodoc:
Quote

"The named file is opened and a file handle returned.  If the accessMode is MODE_OLDFILE, an existing file is opened for reading or writing. If the value is MODE_NEWFILE, a new file is created for writing. MODE_READWRITE opens a file with an shared lock, but creates it if it didn't exist."


(bold mine)


However, in this particular case MODE_READWRITE is better, as it will create the file if it doesn't exist. So in the end you're partially right too (but writing is perfectly ok to MODE_OLDFILE, too!).