From mboxrd@z Thu Jan 1 00:00:00 1970 From: winter Subject: Re: Problems with current file descriptor Date: Thu, 27 Oct 2005 10:34:28 +0800 Message-ID: <16f1140f0510261934i51c53da1m@mail.gmail.com> References: <1130341392.3278.0.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: LINUX-Fs-DEVEL Return-path: Received: from xproxy.gmail.com ([66.249.82.205]:27330 "EHLO xproxy.gmail.com") by vger.kernel.org with ESMTP id S1751542AbVJ0Cee convert rfc822-to-8bit (ORCPT ); Wed, 26 Oct 2005 22:34:34 -0400 Received: by xproxy.gmail.com with SMTP id i30so556267wxd for ; Wed, 26 Oct 2005 19:34:28 -0700 (PDT) To: Sergio Paracuellos In-Reply-To: <1130341392.3278.0.camel@localhost.localdomain> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 2005/10/26, Sergio Paracuellos : > Hi all, > > I have problems to know whats is the current file descriptor. > > "task_struct" have a files_struct structure which contains all files for > a process in "fd". If I want to get the complete path for one of them, > How can I know what is the correct one in fd_array? > > I suppose is something like: > > path = d_path(task->files->fd[x]->f_dentry, > task->files->fd[x]->f_vfsmnt, buf, PAGE_SIZE); > > But I don't know how to know this x for my correct file (for example the > last file I used). current file ?what is meaning? for exmaple ,you opened 3 file, file1,file2, file3. which is current file?