linux内核由struct file获取filename

来源:互联网 发布:color finale mac 编辑:程序博客网 时间:2024/06/08 12:33

参考:

http://stackoverflow.com/questions/17885676/in-linux-how-can-i-get-the-filename-from-the-struct-file-structure-while-ste


获取文件名:

struct file *filp with filp->f_path.dentry->d_iname.

获取全路径:

dentry_path_raw(filp->f_path.dentry,buf,buflen)


0 0
原创粉丝点击