I am wondering how File.exists() works. I'm not very aware of how filesystems work, so I should maybe start reading there first.
But for a quick pre information:
Is a call to File.exists() a single action for the filesystem, if that path and filename are registered in some journal? Or does the OS get the content of the directory and then scan through it for matches?
I presume this will be filesystem dependent, but maybe all filesystems use the quick approach?
I'm not talking about network and tape systems. Lets keep it to ntfs, extX, zfs, jfs :-)