On Sat, Oct 3, 2009 at 8:29 PM, Deepak Mishra <dpux4li...@gmail.com> wrote:
> Hello everyone,
>                          I am very new to this list and kernel programming.
> Maybe this is too early, but I am actually interested in knowing the file
> search module (inherently the source code for "find" program) in linux

Hi Deepak,

"find" is a userspace program and there is no kernel component in it.

> filesystem. I believe there would be seperate search module for every
> filesytem.

The only filesystem specific code which "find" needs to call is how to
traverse directories, and how to get the file names given that each
filesystem will have its own layout. However this is abstracted using
the syscall readdir(). so you don't need to worry about the underlying
layout of the filesystem. You can look at ext2_readdir() for example .

> I feel looking at the codes may help me appreciate the
> filesystems better. I searched the kernel tree and even googled for such
> code, but I feel I am yet not proficient enough to get anything. Hope you
> guys can help me out.

You can try to write your own "find" program in userspace. See the
usage of following syscalls.
readdir(), opendir()

Best of luck.

Thanks -
Manish


> Thanks in anticipation,
> Deepak Mishra



-- 
Thanks -
Manish

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to