faster fopen

Michael J Spitzer mjs at mentor.cc.purdue.edu
Tue Jun 20 05:02:25 AEST 1989


In article <3941 at tank.uchicago.edu> phd_ivo at gsbacd.uchicago.edu writes:
>I have a set of files which never change on my harddisk. I would like
>to index them, so that a program can open any of these files without
>having to first read the directory entry. Is there a way I can open
>files by some other obtained information (e.g. an inode?) and not
>waste time with a directory access?

There is no efficent way to access a file from user level given only
its inode number.  The 4.3BSD namei already maintains a name-cache for
name -> inode translations, so you generally won't be "wasting time"
doing a directory lookup if the file has already been referenced.

		-mjs
--
Michael J. Spitzer		Purdue University Computing Center
mjs at mentor.cc.purdue.edu	pur-ee!mentor.cc.purdue.edu!mjs



More information about the Comp.unix.questions mailing list