createFile() implementation