From owner-freebsd-fs Sun Aug 3 02:40:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA16776 for fs-outgoing; Sun, 3 Aug 1997 02:40:21 -0700 (PDT) Received: from critter.dk.tfs.com (critter.phk.freebsd.dk [195.8.133.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA16718 for ; Sun, 3 Aug 1997 02:39:35 -0700 (PDT) Received: from critter.dk.tfs.com (localhost [127.0.0.1]) by critter.dk.tfs.com (8.8.6/8.8.5) with ESMTP id LAA10682; Sun, 3 Aug 1997 11:38:31 +0200 (CEST) To: "Matthew N. Dodd" cc: fs@FreeBSD.ORG From: Poul-Henning Kamp Subject: Re: Open by Inode# In-reply-to: Your message of "Sun, 03 Aug 1997 04:52:00 EDT." Date: Sun, 03 Aug 1997 11:38:30 +0200 Message-ID: <10680.870601110@critter.dk.tfs.com> Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk In message , "Matthew N. Dodd" writes: > >I'm involved in writing an application that would benefit from the ability >to open a file by its inode# rather than its filename. > >A friend of mine has done something similar under Linux/ext2fs (see >http://www.news.erols.com/patches/ext2_inum.diff for details). > >I envision something like > >int iopen(ino_t inode, int flags) > >Obviously file creation via this call would be silly. > >Is something like this even feasible? Certainly. The easiest way is to hack namei so that a filename of the form '#i[0-9]*' would open by inode. Be aware that this has significant (negative) security impact. -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@tfs.com TRW Financial Systems, Inc. Power and ignorance is a disgusting cocktail.