On Friday 04 February 2011 08:49:31 HuangAlex wrote:
> Hi all,
>
> As mentioned in the note, yaffs treat everything as object. So i wonder how
> the directory structured in yaffs? Every directory have one chunk or many
> chunks? What is the chunkid and objectid for a directory?
>
> Thank you all.
>
> Alex
Alex
Please read
http://www.yaffs.net/files/yaffs.net/HowYaffsWorks.pdf
Directories are not stored in the flash. These are built up from the object
headers on the fly and formed into lists of objects in the same directory.
Each object knows which object is its parent. This is stored in the object
header
For example consider:
object id 500 file "a", parent is object id 503
object id 501 file "b", parent is object id 503
object id 502 directory "d", parent is 1 (1 is the root)
object id 503 directory "dir" parent is 502
that gives us the following paths
object id 1"/"
object id 500 "/d/dir/a"
object id 501 "/d/dir/b"
object id 502 "/d"
object id 503 "/d/dir"