Thursday 12 December 2013

understanding inode





understanding inode

 The POSIX standard mandates filesystem behavior that is strongly influenced by traditional UNIX filesystems. Regular files must have the following attributes:


    The size of the file in bytes.
    Device ID (this identifies the device containing the file).
    The User ID of the file's owner.
    The Group ID of the file.
    The file mode which determines the file type and how the file's owner, its group, and others can access the file.
    Additional system and user flags to further protect the file (limit its use and modification).
    Timestamps telling when the inode itself was last modified (ctime, inode change time), the file content last modified (mtime, modification time), and last accessed (atime, access time).
    A link count telling how many hard links point to the inode.
    Pointers to the disk blocks that store the file's contents (see inode pointer structure).

The stat system call retrieves a file's inode number and some of the information in the inode.

Note: it don't carry the filename.

The stat() and lstat() functions take a filename argument. If the file name is a symbolic link, stat() returns attributes of the eventual target of the link, while lstat() returns attributes of the link itself. The fstat() function takes a file descriptor argument instead, and returns attributes of the file that it identifies.


stat MemcachedNetstatCount.py
  File: `MemcachedNetstatCount.py'
  Size: 339       Blocks: 8          IO Block: 4096   regular file
Device: 801h/2049d Inode: 590281      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-12-22 11:18:12.000000000 -0500
Modify: 2013-12-21 11:13:37.000000000 -0500
Change: 2013-12-21 11:13:37.000000000 -0500


Referred link:

http://en.wikipedia.org/wiki/Inode
http://en.wikipedia.org/wiki/Stat_%28Unix%29
http://en.wikipedia.org/wiki/System_call
   

No comments:

Post a Comment