Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Aug 2003 11:02:23 +0200
From:      Pawel Jakub Dawidek <nick@garage.freebsd.pl>
To:        Tim Kientzle <kientzle@acm.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Inode Operations
Message-ID:  <20030824090223.GW47959@garage.freebsd.pl>
In-Reply-To: <3F4828F5.8090207@acm.org>
References:  <3F4828F5.8090207@acm.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--KRJ4yArSHF8vY7I3
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 23, 2003 at 07:54:45PM -0700, Tim Kientzle wrote:
+> 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.)
+>=20
+> 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.
+>=20
+> Question: Are there any system calls that allow you to
+> access/modify a file based only on the device number/inode number?

Check getfh(2)/fhopen(2) syscall if you are root.

--=20
Pawel Jakub Dawidek                       pawel@dawidek.net
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net

--KRJ4yArSHF8vY7I3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iQCVAwUBP0h/Hz/PhmMH/Mf1AQG4pQQAnaruTo/0GKFzrwkpS4PiaQwl9dHPLTSM
YHcoqqPxhyVJ5PydPi5neERV1z8Ldpng2vYQc4Zn/zzWye089TN86cpMreB/06xG
+E7XldE6DiXwSSjIxbRVWUxEVtc391R4mWmVcfnJhfeFRCzYp5x2fp+ddfkBIuyt
tgOlaFEuPGA=
=JSDM
-----END PGP SIGNATURE-----

--KRJ4yArSHF8vY7I3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030824090223.GW47959>