This is an unsafe loop. I get what you are trying to do here, but in that case you should rescue `EEXIST` specifically to retry generating the file. Otherwise, if any error happens to the `open` call - say, bad permissions - and you will enter a non-terminating loop which will eventually segfault when `i` becomes big enough.