[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Filename to "inode" pointer in C
files in userspace are file descriptors.
files in kernel space are pointers to virtual nodes.
to get an associated vnode for file in kernelspace,
`namei' function should be used. check the filesystem
code for the usage example.
to get the low level info in userspace, use `stat', as
was suggested earlier.
On Sun, Nov 03, 2002 at 01:32:57AM -0800, John D. wrote:
> Is there any C library or function that can take a file name or path, and convert it into an "inode" pointer. I need a pointer to an "inode" structure. I'm also going to want to get the "inode" number. But I can get that from the "i_number" field in the "inode" structure.
>
> Any code that comes close to this, would be most helpful.
>
> Thanx