On Mon 31 Jan, 2000, "Bruce Sterling Woodcock" sirbruce@ix.netcom.com wrote:
It's not Solaris per se; it's been a standard UNIX-ism for a long time.
Yup. Before 4.2BSD, there wasn't an rmdir and directories were made and removed with link/unlink (so not very atomic). Excerpt from SunOS 4.1.x man pages:
unlink (8V):
WARNINGS Only the super-user can unlink a directory, in which case the files it contains are lost. The files can, however, be recovered from the file system's lost+found directory after performing an fsck.
unlink (2V):
NOTES Applications should use rmdir(2V) to remove directories. Although root may use unlink() on directories, all users may use rmdir().
Of course, it's awkward for root - especially if something changes from a file to a directory whilst it's not looking - as there doesn't seem to be a way to call unlink whilst saying 'but not directories'.
James.