---
layout: docs
title: writeFileIfChanged
id: class.Facebook.HackCodegen._Private.Filesystem.writeFileIfChanged
docid: class.Facebook.HackCodegen._Private.Filesystem.writeFileIfChanged
permalink: /docs/reference/class.Facebook.HackCodegen._Private.Filesystem.writeFileIfChanged/
---
# Facebook\\HackCodegen\\_Private\\Filesystem::writeFileIfChanged()




``` Hack
public static function writeFileIfChanged(
  string $path,
  string $data,
): bool;
```




## Parameters




* ` string $path `
* ` string $data `




## Returns




- ` bool `