I am trying to open a file for writing into it. The file may not exist.
I found that [NSFileHandle fileHandleForWritingAtPath:filePath]
returns nil if file does not exist.
Having googled, I found code snippets like this
[[NSData data] writeToFile:filePath atomically:YES]
which, I guess, ensures file existance before opening it.
My questions is: is the latter code line recommended way of file creation? It seems strange that NSFileHandle has no routine to create a new file (and only can deal with existing files).