This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Names doubt in Linux

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

What is an inode in Linux? What meaning does it have with respect to filenames?
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is confusing is that multiple file names point to an inode. But it is also known that inodes are unique... What would that mean? I do not understand how multiple filenames point to one inode?
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I do not understand how multiple filenames point to one inode?

With hard link, more than one file name can refer to the same inode.

Wiki
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This link maybe useful for you.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17622
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's plenty of good literature on inodes and their functions, but the key thing is that it's different from DOS/Windows. In DOS, the directory referred directly to a file. In Unix/Linux, it's the inode that does that. The directory is basically a name/value pairing that associates an inode with a filename (along with some other things, like access rights).

The main consequences are

1. Multiple filenames in multiple directories can refer to the same file (hard links) as long as it's on the same device (inodes are not unique between different devices).

2. Locking is done on inodes, and not on directories. Which is one of the main reasons why Windows has "reboot fever" - Windows locks on the filename. In Unix/Linux, you can assign a new inode (file) to a directory entry, and running apps will continue to use the old file (usually), but new references will be via the new inode. So all that's required to update a system resource is to assign a new inode and restart the software that references that file. Instead of the whole OS.

I think I had a third item, but I've forgotten it already.

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for the participation.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic