On Mon, Jul 27, 2009 at 2:49 PM, Dan Danillo<[email protected]> wrote:
>
> Hello,
>
>
>
>>
>> Hi Dan,
>>
>>
>> On Mon, Jul 27, 2009 at 11:54 AM, Dan Danillowrote:
>> > Hello,
>> >
>> > I'm trying to find out how to browse the file system from the linux kernel.
>>
>> What exactly do you mean by that.
>> Do you mean that you want to traverse the namespace being inside the
>> kernel through some kernel module or something?
>
> Yes, I want to write a module which gets as parameter the path to a directory.
> In the module I want to be able to find all files and subfolders in that 
> directory.
>
>> > Especially the directory content is interesting to me.
>> > Can anyone give me a hint? Are there even some libc like functions to do
>> > that ?
>> >
>>
>> The libc functions like these map to the kernel code eventually, so
>> mostly there will be one.
>>
>> > So far I have found the filp_open, vfs_read and vfs_readdir functions.
>> >
>> > However, the vfs_readdir function expects a function pointer to somehow
>> > format the directory information.
>> > My assumption is that this is the wrong function.
>> > So I guess that's not the function I'm after.
>> >
>>
>> Do you want it at vfs layer ....
>> or at the file system level....
>
> Mh, I don't really have a clue. What are the differences?
> I'm not  interested in all the inode information or some funky stuff.
> I just need to know if it is a file or directory, filesize and where to find 
> the data of the file.


Hi,

Have a look at vfs_path_lookup() . In particular probably you want path_walk().

Thanks -
Manish

>
>> What all information do you have before you could call this function
>> which will traverse the file system hierarchy for you?
>
> Just the path to the directory
>
> Dan
>
>
>
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [email protected]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>



-- 
Thanks -
Manish

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to