Subject: Re: "." as the first entry..
To: Jorgen Lundman <lundman@lundman.net>
From: Giles Lean <giles@nemeton.com.au>
List: netbsd-users
Date: 03/01/2003 11:28:09
Jorgen Lundman wrote:

> Now, readdir() makes no promise that this is always the case, but, in 
> Unix, can you "reasonably" safely assume this is the case? I would 
> assume when you create a directory, "." (and "..") is always created in 
> slot 0 and 1 of the directory, and in a healthy filesystem, remain in 
> that position?
> 
> Unless you manage to delete and re-create it.
> 
> true for BSD? For Unix?

Years ago I saw a FFS (UFS/HFS/whatever) directory on HP-UX that lost
its ".."  entry.  It was necessary to re-create it in slot 1 or else
something (fsck?) was not happy.

I don't know therefore whether you *should* rely on slot 0 being "."
and slot 1 being ".." but people before you have ...

Regards,

Giles