Re: inode for a given vnode or filepath.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707) -----Original Message----- From: "Maxim Zhuravlev" <maxim.zhuravlev@gmail.com> To: darwin-kernel@lists.apple.com Date: Thu, 31 Jul 2008 15:23:51 +0400 Subject: inode for a given vnode or filepath. Hi, all. I would like to find out, how can I get an inode number for a given vnode or filename. For a vnode I can use vnode_getattr(), but it requires vfs context as one of it's parameters. I can get the context by using vfs_context_current(), but it seems to be in com.apple.kpi.unsupported. Are there any other *supported* ways to get inode number (va_fileid in vnode_attr structure) and device id (va_fsid in vnode_attr structure)? And at last, does inode number and/or device id change over time and, if they do, under what circumstances? Thanks in advance, - Maxim. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/lutzh%40autonomy.com This email sent to lutzh@autonomy.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com To get the inode number from a path you can simply use stat(). The inode is stored in st_inode within the stat structure. Cheers, lutz smime.p7s
participants (1)
-
Lutz Helwing