From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 23 19:54:02 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7008716A4BF for ; Sat, 23 Aug 2003 19:54:02 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id E41D143FB1 for ; Sat, 23 Aug 2003 19:54:01 -0700 (PDT) (envelope-from kientzle@acm.org) Received: from acm.org (big.x.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id h7O2s1sE048833 for ; Sat, 23 Aug 2003 19:54:01 -0700 (PDT) (envelope-from kientzle@acm.org) Message-ID: <3F4828F5.8090207@acm.org> Date: Sat, 23 Aug 2003 19:54:45 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030524 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.ORG Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Inode Operations X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Aug 2003 02:54:02 -0000 I'm working on some archiving programs and need to (for various reasons) keep track of a very large number of files so that I can revisit them at the end of the operation. For example, on extract, I need to set directory access times and permissions after the complete extract is finished, which requires me to record every created directory. (No, there is no way around this short of re-scanning the entire archive a second time, which is impractical at best.) Right now, I'm storing the full pathname of each such file, but that is taking up a lot of memory, so I'm looking for a more compact approach. It occurred to me that the device number/inode (as returned by stat(2)) is another way to uniquely identify a file. As it turns out, I need to stat() everything anyway, so collecting such identifiers is easy. But, I can't find any system calls that actually use this information. Question: Are there any system calls that allow you to access/modify a file based only on the device number/inode number? Tim Kientzle