简体   繁体   English

使用Runtime.getRuntime()。exec()在Android上执行“状态”时出现IOException吗?

[英]IOException when using Runtime.getRuntime().exec() to exec “stat” on Android?

The key code is: 关键代码是:

Process process = Runtime.getRuntime().exec("stat", null, file);

and I get the IOexception: 我得到IOexception:

java.io.IOException: Error running exec(). Command: [stat] Working Directory: /storage/emulated/0/Pictures Environment: null

I noticed that this problem happens only on some Android 5.x devices, and 6.x devices work fine. 我注意到此问题仅在某些Android 5.x设备上发生,并且6.x设备可以正常工作。 And when I test "ls" command it works fine for all my devices. 当我测试“ ls”命令时,它对我所有的设备都适用。 What can cause the problem? 是什么原因引起的?

命令“ stat”不正确。如果要打开资源管理器,请使用“开始”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM