If the file node is not accessible yet, NativeInterface.writeFile() will return -EACCES instead of -EPERM. Thanks @msurguy for reporting this and testing.