Empty symlinks and full POSIX compliance
Empty symlinks and full POSIX compliance
Posted May 28, 2013 20:18 UTC (Tue) by ms-tg (subscriber, #89231)In reply to: Empty symlinks and full POSIX compliance by etienne
Parent article: Empty symlinks and full POSIX compliance
Posted May 29, 2013 9:04 UTC (Wed)
by etienne (guest, #25256)
[Link]
Did not read the source code, but extracted from:
Empty symlinks and full POSIX compliance
http://lwn.net/Articles/325126/
-------
If a file is deleted which exists at the bottom layer, a so-called
whiteout file with the same name is created at the top layer. Users
never get to see this file; it is not included in readdir results, and
trying to open it fails with errno == ENOENT. If a file with the same
name is later created, this file replaces the whiteout.
-------
readdir() could forget to list empty symlinks, but anyway if the file is listed in readdir() trying to open it would look like the file did exist but has now disappeared - i.e. has been removed since readdir() was initialised.