c# - Why is File.Open so much better than File.Create for overwriting an existing file? -


This is in relation to another that asks to overwrite an existing file.

Top of the answer is:

  filestream file = file. Open ("text.txt", FileMode.Create);  

My answer was:

  file stream fs = System.IO.File.Create (fileName);  

When I wrote this question, Milan was 14-0 in favor of open .

If the sign of the vote is a good vs bad solution, it makes me wonder:

Am I missing in some ways that make it clear clearly? Will open create ?

For me, I know exactly what is File.Open ("...", FileMode.Create) because I can hover over FileMode.Creative and it tells me that a new file will be created every time. Create.Create ("...") There is no tool tip which indicates that it will do so.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -