Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Inode
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===inode number conversion and file directory path retrieval=== It is typically not possible to map from an open file to the filename that was used to open it. When a program opens a file, the operating system converts the filename to an inode number and then discards the filename. As a result, functions like [[direct.h|{{mono|getcwd()}}]] and [[direct.h|{{mono|getwd()}}]] which retrieve the current [[working directory]] of the process, cannot directly access the filename. Beginning with the current directory, these functions search up to its [[parent directory]], then to the parent's parent, and so on, until reaching the [[root directory]]. At each level, the function looks for a directory entry whose inode matches that of the directory it just moved up from. Because the child directory's inode still exists as an entry in its [[parent directory]], it allows the function to reconstruct the [[absolute path]] of the current [[working directory]]. Some operating systems maintain extra information to make this operation run faster. For example, in the [[Linux]] VFS,<ref>{{cite web | url = https://www.kernel.org/doc/html/latest/filesystems/vfs.html | title=Overview of the Linux Virtual File System | author=Gooch, Richard | editor=Enberg, Pekka | website=kernel.org | access-date=20 May 2023}}</ref> directory entry cache,<ref>{{cite web | url = https://www.kernel.org/doc/html/latest/filesystems/vfs.html#directory-entry-cache-dcache | title=Directory Entry Cache (dcache) | author=Richard Gooch | editor=Enberg, Pekka | website=kernel.org | access-date=20 May 2023}}</ref> also known as dentry or dcache, are cache entries used by the [[Kernel (operating system)|kernel]] to speed up filesystem operations by storing information about directory links in [[Random-access memory|RAM]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)