You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Docs)(DOCUMENT-1429) Update find_file() comment in files.rb
Testing confirms that the `find_file()` function may indeed be used to
verify the existence of a file specified by absolute path, with the
caveat that this check appears to be performed prior to any resource
changes made by the same code.
The following code, when run via "puppet apply", accurately reports the
existence or non-existence of a test file *before* deleting that file.
```
$testpath = '/tmp/testfile'
file { $testpath: ensure => absent }
if find_file($testpath) {
notify { "$testpath exists.": }
} else {
notify { "$testpath does not exist.": }
}
```
0 commit comments