File.create (string filePath) This usage is known to all, but the two days of use have found a problem.
You need to determine whether a file exists, create a file if it does not exist, and then write data to it, and then append the data in later time.
If the file already exists, writing the data is completely fine. When the file does not exist, the file is created immediately after the file is written to the file, error, prompting the file is being occupied by other programs.
The last reason to find out is that file created files need close: Nani? I've never been closed before. It's hard to remember what I've written.
Because you always remember that stream needs to be closed, read and write streams need close, images need to release resources, so the default feeling is that file does not need close.
When looking for reasons to see a lot of ape friends also made this mistake, in the future to remember. Remember, remind yourself.
I'm not the only one who makes this mistake. about file