An atomic query obtains related filesystem observations through one indivisible action. This prevents a path from changing between separate checks, such as testing whether it is a regular file and then retrieving its size. section 9.11
Separate filesystem requests can observe different states: another process may replace a regular file with a directory, or modify the file after its size is checked. Therefore, a size check does not guarantee how much data a later read will consume. section 9.11
Prefer these defensive patterns:
- Avoid assuming that Files.size(), File.length(), or similar results still match file content when reading later. section 9.11
