Emits error if file creation fails