From owner-freebsd-hackers Mon Feb 4 1:28:21 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from avocet.prod.itd.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by hub.freebsd.org (Postfix) with ESMTP id 7CB5837B41C for ; Mon, 4 Feb 2002 01:28:18 -0800 (PST) Received: from pool0039.cvx40-bradley.dialup.earthlink.net ([216.244.42.39] helo=mindspring.com) by avocet.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16XfPc-00059x-00; Mon, 04 Feb 2002 01:27:44 -0800 Message-ID: <3C5E540B.9FDACF64@mindspring.com> Date: Mon, 04 Feb 2002 01:27:39 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: =?iso-8859-1?Q?Pawe=B3?= Jakub Dawidek Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: File name. References: <20020203221137.A34994@FreeBSD.pl> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Pawe=B3 Jakub Dawidek wrote: > I can get vnode of changed file. > I can get inode number of changed file. > But how can i get file name? > = > There is a way to get inode when i have file name and p (struct proc), = so > maybe there is a way to get file name from inode number and p. > = > And another thing for chflags syscall. > I got file name, but how can I get full path name for this file? char *saved_name; func() { char *foo; ... fd =3D open( foo, O_RDWR, 0664); saved_name =3D strdup( foo); ... printf( "name that goes with fd %d is '%s'\n", fd, saved_name); ... } i.e.: You opened the thing, you ought to know its name. = -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message