来自nautilus的Android设备外部存储上的隐形文件

时间:2015-10-25 20:36:53

标签: android ubuntu storage visible invisible

我很抱歉花时间,所以我会尽量缩短时间。最重要的是,如果我的英语错了或者我犯了愚蠢的错误,我道歉,英语不是我的母亲。我很抱歉,如果答案很愚蠢,我还没有尝试制作Android应用程序。
我正在制作一个Android应用程序而我正试图存储一些文件在外部存储上的公用文件夹上。我有一个问题,我不知道会发生什么。 问题是这样的:

我在'下载'中有一个文件。目录。然后我将文件移动到我的公共文件夹,然后我重命名它(所有这些通过代码)。一切似乎都很好,文件被正确移动,可读和可写。然后,该文件可以通过'文件指挥官等应用程序查看。虽然,当我将手机与电脑连接时,使用nautilus(ubuntu文件夹应用程序)无处可见文件,即使使用终端(sudo ls -a也不会改变一件事)。

String path = (Environment.getExternalStoragePublicDirectory("myAppFolder").getAbsolutePath() + "/inside_folder/" + fileToMove.getName())
File folder = new File(path);
folder.mkdir();
File thatFile = new File (folder.getAbsolutePath() + "/downloading");
if (thatFile.exist()) thatFile.delete();
try {
   FileInputStream instream = new FileInputStream(fileToMove);
   FileOutputStream outstream = new FileOutputStream(thatFile);
   FileChannel inChannel = instream.getChannel();
   FileChannel outChannel = outstream.getChannel();
   inChannel.transferTo(0, inChannel.size(), outChannel);
   instream.close();
   outstream.close();
   outChannel.close();
   inChannel.close();
} catch (IOException e1) {
   e1.printStackTrace();
}
thatFile.renameTo(new File(folder.getAbsolutePath + "/coucou"));

出于某种原因,如果文件是使用'文件命令管理员重命名,则现在可以通过nautilus看到该文件。此外,如果没有其他文件,而不是一个名为' coucou'然后,我将无法探索myAppFolder / inside_folder / imafile / coucou,myAppFolder(以及内部文件夹)无法访问。我怎么能改变呢?如果没有File Commander,我怎样才能看到它。另外,我想知道文件怎么能看不见......无论如何,谢谢你的时间和帮助: - )。

编辑:重新启动设备清除问题。然而,如果创建了新文件,则在新的重新启动之前会出现赢(或者现在看起来如此)。我不想让用户每次都这样做。有谁知道如何解决这个问题?谢谢你:)。

0 个答案:

没有答案