|
|
|
|
|
by Brian_K_White
592 days ago
|
|
You don't use exists and then open a file. If you actually want to open a file, you open it or fail. You don't check if it's ok and then do it, you do it and then check if it failed. exists followed by open is a pointless exists because anything can happen in between. Conversely, if you are neither the producer nor consumer of the file at this time, you don't want to actually open it just as a way to stat it, because actually opening it updates it's access time and interferes with the actual consumer(s). Even read-only non-exclusive. |
|