Can anyone explain what the difference is between the creation dispositions OPEN_ALWAYS and CREATE_ALWAYS of the CreateFile() function of the windows API?
To me it seems that they both simply ‘create the file if it does not already exist’.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CREATE_ALWAYSalso truncates the contents if the file already exists. On the other hand,OPEN_ALWAYSwill not clobber an already existing file.Here’s how the different values work in tabular form: