---
layout: docs
title: createOnly
id: class.Facebook.HackCodegen.CodegenFile.createOnly
docid: class.Facebook.HackCodegen.CodegenFile.createOnly
permalink: /docs/reference/class.Facebook.HackCodegen.CodegenFile.createOnly/
---
# Facebook\\HackCodegen\\CodegenFile::createOnly()




If called, save() will only write the file if it doesn't exist




``` Hack
public function createOnly(): this;
```




## Returns




+ ` this `