Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The first example[1] has a classic look-before-you-leap stupidity. That's not a great look!

  match File.exists(f) {
  ...

  match File.stat(f) {
The file can be removed after the first call, before the second. Just call stat and handle ENOENT correctly.

[1]: The page seems to randomize which one is shown. I got the "File information" one in the dropdown.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: