访问MODE_WORLD_READABLE文件在Android设备上的应用程序私有目录 [英] Access to MODE_WORLD_READABLE files in application private directory on Android devices

查看:1964
本文介绍了访问MODE_WORLD_READABLE文件在Android设备上的应用程序私有目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经建造了用于收集数据(统计排球)的Andr​​oid应用程序。此应用程序创建,我们最终要被转移到台式电脑数据文件(Windows个人电脑和苹果机)。

We have built an Android application which is used to collect data (for volleyball stats). This application creates a data file which we ultimately want to be transferred to desktop computers (Windows PCs and Macintoshes).

目前,我们写出来的数据作为默认的应用程序目录的简单字符流(数据/数据​​/应用程序的名字/文件),并指定MODE_WORLD_READABLE当我们创建这些数据文件。

We currently write the data out as a simple character stream in the default application directory (data/data/appname/files) and specify MODE_WORLD_READABLE when we create each of these data files.

的问题是,即使该数据文件是MODE_WORLD_READABLE,这是我们想用传送数据无法看到的数据文件中的各种用途。我认为这个问题是他们可能已经阅读访问这些文件,但他们没有读访问其中文件的存储目录。具体来说,我无法浏览到使用Android设备上的ES文件浏览器的应用程序文件和我无法将我的Andr​​oid设备连接到PC或Macintosh的USB设备来浏览文件。

The problem is that even though the data files are MODE_WORLD_READABLE, the various utilities which we would like to use to transfer the data cannot see the data files. I assume that the problem is that they may have read access to the files, but they do not have read access to the directories in which the files are stored. Specifically, I am unable to browse to the files using the ES File Explorer app on the Android device and I am unable to browse to the files when I connect my Android device to the PC or Macintosh as a USB device.

是我写的文件到外部目录的唯一的解决办法,或者是有什么我这里缺少有关使用MODE_WORLD_READABLE与应用程序目录?

Is my only solution to write files to the external directories, or is there something I am missing here about using MODE_WORLD_READABLE with application directories?

推荐答案

应用程序根目录(通常类似于文件访问模式 /data/data/com.package.app <​​/ code>),并在它的顶部目录(数据库文件缓存,...)为 rwxrwx - X 。对于其他用户数超过了应用程序本身相关的部分是 - X ,这意味着该目录不能被读取(浏览),但是它们可以被穿越。所以,如果你知道你在寻找什么(完整路径),你可以阅读 MODE_WORLD_READABLE 文件。

The file access mode for the application base directory (usually something like /data/data/com.package.app) and the top directories in it (databases, files, cache, ...) is rwxrwx--x. For other users than the application itself the relevant part is --x, which mean the directories can not be read (browsed) but they can be traversed. So you can read MODE_WORLD_READABLE files if you know exactly what you are looking for (the complete path).

这篇关于访问MODE_WORLD_READABLE文件在Android设备上的应用程序私有目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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