![]() |
where does file system keeps file name in the file system data structure
Hi,
I want to know where does the file system keeps information of all files present in the file system. inode only keeps the information of size,attribs, other than the name of the file. Ex :If i want to access a file a.txt in the file system , how does the read operation takes place , and if i want to write the same a.txt file under same partition or directory how does file system finds the duplicate file , Here my ultimate doubt is if a write operation has to take place ,a read operation must take place to get the file name if it is already present or not in the filesystem (directory). If i am not clear please let me know where i am not clear. |
I see 2 questions here:
1. The inner workings of the filesystem--i.e. where info is actually stored. 2. The mechanics of writing a file. In the latter case, I assume that the system calls behind--e.g--the "mv" command include a read operation to see if the file exists. As for the 1st question, Use Google to look up the filesystem spec. for the system you are using. |
The filename is typically an entry in the directory/folder that 'contains' the file.
There is not a one-to-one correspondence between filenames and inodes. There can be more than one filename that points to the same inode. And yes, if you open a file, the open has to read the directory entry in order to find the inode, and read the inode entry as well. |
Hi,
Look at 'Linux File System' section of 'Slackware-Links' for a lot of helpful information that will aid to understanding the filesystem. :hattip: The above link and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! |
Quote:
Thank u very much.....:D |
All times are GMT -5. The time now is 03:59 PM. |