[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: purpose of "." entry in a diretory
> Let me rephrase my question a little bit: BESIDES the obvious usage of
> "." entry, in terms of the filesystem, what is the purpose of "." entry?
>
> The obvious answer is that you can refer to the current directory using
> "./", however, in order to look up the "." entry, the kernel must have a
> knowledge of the current directory in the first place, doesn't it? The
> kernel needs the directory table for the current directory to look up
> which inode the "." entry refers to. Doesn't that seem a little
> redundant, since the kernel already knows what the current directory is?
> If the kernel is already caching the current directory table, it might
> as well just cache the current directory's inode.
I think you touched the point. There MIGHT be a situation in which you don't
have the inode of the current directory, just the table, and you want to
access the inode.
Tomas
>
> Coming back to my original question, does the kernel really need that
> "." entry? or is it purely for the user convenience?
>
> cheers,
>
> jz
>
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive: http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
--
"No Software Patents!" -- Allowing patents over software ideas will
seriously affect the Creativity, Productivity and Freedom of all.
Link: http://www.nosoftwarepatents.com/
--
Defend your freedom by signing a petition.
Link: http://petition.eurolinux.org/index_html?LANG=en
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/