• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File Names doubt in Linux

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

What is an inode in Linux? What meaning does it have with respect to filenames?
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This link maybe useful for you.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys for the participation.
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic