如何在java中通过文件描述符打开文件? [英] How to open file through file descripter in java?

查看:283
本文介绍了如何在java中通过文件描述符打开文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从文件描述符中打开文件?

解决方案

我计划了以下内容,请告诉我可能吗?

1.决定在android程序本身执行lsof命令进程

(Android每个应用程序由单独的进程表示,所以我将能够检索其进程ID)

所以命令将是

> lsof ProcessIDOfApp

输出将是包含FD的表以及包含其他信息的名称

2.Map the FD为其名称

当我们得到文件名时,我们将能够创建输入/输出流。


参见http://docs.oracle.com/javase/7/docs/api/java/io/FileDescriptor.html [ ^ ]。

How to open File from File Descriptor?

解决方案

I have planed the following thing,please tell me will it possible?
1.Decided to execute lsof command in android program itself for the process
(Android each app is represented by separate process,so i will able to retrieve its process id)
so command will be
>lsof ProcessIDOfApp
output will be table containing FD as well as is name including other information
2.Map the FD to its name
when we get the file name we will able to create the input/output stream.


See http://docs.oracle.com/javase/7/docs/api/java/io/FileDescriptor.html[^].


这篇关于如何在java中通过文件描述符打开文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆