Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to access inode information Post 302280743 by jim mcnamara on Tuesday 27th of January 2009 01:37:30 PM
Old 01-27-2009
Oh. You probably want to look into opendir(), readdir(), -- look at dirent.h also.
This gives you the inode number. stat() gives you what find uses to select files.
See /usr/include/sys/stat.h
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file access inode update

When is a file "accessed" according to UNIX? For example: gzipping a file will not change the access time. (1 Reply)
Discussion started by: dangral
1 Replies

2. Shell Programming and Scripting

INode

hi i am nitin... jus a new kid on the block... my query is... does the concept of region invovle sharin of inodes wen the sticky it is set... eg... if two process share two text regions... wat actually happens thank u (1 Reply)
Discussion started by: nitinsharma_ssn
1 Replies

3. Filesystems, Disks and Memory

Inode number

as kernel keeps track of user activities on a file by its INODE number and I node table . what is the structure of Inode table. and where does this Inode table mapped into?user space or kernel space? is the Inode Number is fixed for a file till its deletion? thanks (1 Reply)
Discussion started by: compbug
1 Replies

4. Red Hat

inode no and fd path

hi, can anyone please tell me where i can extract inode numbers and path associated with all file descriptors. i want these informations only. is there any system call or functions to get these things? i hav a RHEL 4. also /proc/pid/fd shows some file descriptor list. is that the proper path to... (1 Reply)
Discussion started by: sanjaykhuntia
1 Replies

5. Solaris

about inode

how can i see inode table information of a perticler inode.anybody knows pls tell me. Than.Q (3 Replies)
Discussion started by: nag.mi2000
3 Replies

6. AIX

FS inode 58%

Hi Guys, I have this filesystem got big with inode: /dev/hd4 3670016 183664 95% 63705 58% /var I don't know why the system doesn't give alerts on this FS although it's 95% and why the inode is 58%. Any comments will be highly appreciated. Thanks, itik (1 Reply)
Discussion started by: itik
1 Replies

7. Programming

C++ application: how to access AIX process and cpu information?

Hi, may be this is an AIX noob question: my current C++ application runs on Linux and is quite memory consuming. Therefore, the application writes a logfile after it has finished containing memory information, CPU information, information on the running other processes besides my application... (0 Replies)
Discussion started by: DarthVader77
0 Replies

8. UNIX for Dummies Questions & Answers

inode filename

can someone please tell me why is the filename not inlcuded in the inode of the file? (2 Replies)
Discussion started by: wowman
2 Replies

9. Solaris

inode in solaris

Dear, How can i check inode information in my Solaris box? With Regards, Mjoshi (4 Replies)
Discussion started by: mjoshi87
4 Replies

10. UNIX for Dummies Questions & Answers

How do you find max filesize with inode information ?

How do you find the maximum file size with the following information -: A unix filesystem has 1024 bytes block size with 32-bit address. The i-node has 12 direct and 1 indirect, 1 double indirect, and 1 triple indirect addresses. What is the maximum file size it can access ? What is the... (1 Reply)
Discussion started by: sreyan32
1 Replies
GETDENTS(2)						     Linux Programmer's Manual						       GETDENTS(2)

NAME
getdents - get directory entries SYNOPSIS
#include <unistd.h> #include <linux/types.h> #include <linux/dirent.h> #include <linux/unistd.h> _syscall3(int, getdents, uint, fd, struct dirent *, dirp, uint, count); int getdents(unsigned int fd, struct dirent *dirp, unsigned int count); DESCRIPTION
getdents reads several dirent structures from the directory pointed at by fd into the memory area pointed to by dirp. The parameter count is the size of the memory area. The dirent structure is declared as follows: struct dirent { long d_ino; /* inode number */ off_t d_off; /* offset to next dirent */ unsigned short d_reclen; /* length of this dirent */ char d_name [NAME_MAX+1]; /* file name (null-terminated) */ } d_ino is an inode number. d_off is the distance from the start of the directory to the start of the next dirent. d_reclen is the size of this entire dirent. d_name is a null-terminated file name. This call supersedes readdir(2). RETURN VALUE
On success, the number of bytes read is returned. On end of directory, 0 is returned. On error, -1 is returned, and errno is set appro- priately. ERRORS
EBADF Invalid file descriptor fd. EFAULT Argument points outside the calling process's address space. EINVAL Result buffer is too small. ENOENT No such directory. ENOTDIR File descriptor does not refer to a directory. CONFORMING TO
SVr4, SVID. SVr4 documents additional ENOLINK, EIO error conditions. SEE ALSO
readdir(2), readdir(3) Linux 1.3.6 1995-07-22 GETDENTS(2)
All times are GMT -4. The time now is 05:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy