From: "Helight.Xu" <helight.xu@gmail.com>
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 如何通过fd找到打开文件的路径及名称
Date: Mon, 23 Nov 2009 09:02:33 +0800 [thread overview]
Message-ID: <4B09DF29.8020003@gmail.com> (raw)
In-Reply-To: <20091122163700.GC3476@hack>
Américo Wang wrote:
> On Fri, Nov 20, 2009 at 02:33:48PM +0800, Helight.Xu wrote:
>
>> 在用户程序中打开文件进行编辑,那在内核中如何能通过open后的fd
>> 来找到相应打开文件的路径及其名字呢?
>>
>>
>
> 问题是你为什么要在内核中做呢?在用户空间完全可以完成:
>
> % readlink /proc/<PID>/fd/X
>
我是想在内核中实现一些功能,所以现在内核中找到文件的路径及其名称,现在只
能找到文件名,还在找路径。。。
>
>
--
---------------------------------
Zhenwen Xu - Open and Free
Home Page: http://zhwen.org
next prev parent reply other threads:[~2009-11-23 1:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-20 6:33 如何通过fd找到打开文件的路径及名称 Helight.Xu
2009-11-20 8:12 ` 如何通过fd找到打开文件的路径及名称 Xiaotian Feng
2009-11-20 9:55 ` 如何通过fd找到打开文件的路径及名称 Helight.Xu
2009-11-22 16:37 ` 如何通过fd找到打开文件的路径及名称 Américo Wang
2009-11-23 1:02 ` Helight.Xu [this message]
2009-11-23 14:41 ` 如何通过fd找到打开文件的路径及名称 Américo Wang
[not found] ` <alpine.LRH.2.00.0911231605340.3659@twin.jikos.cz>
2009-11-23 15:31 ` 如何通过fd找到打开文件的路径及名称 Américo Wang
2009-11-24 12:03 ` non-english on list (was Re: ????????????fd????????????????????????????????????) Pavel Machek
2009-11-24 14:10 ` David Newall
2009-11-24 14:58 ` non-english on list Américo Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B09DF29.8020003@gmail.com \
--to=helight.xu@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox