在我的用户应用程序读取的/ proc /净/ xt_qtaguid /统计,造成显示java.lang.NullPointerException [英] read /proc/net/xt_qtaguid/stats in my user application and caused java.lang.nullpointerexception
问题描述
我搜索的问题。他们似乎可以读出与NullPointerException异常在/ proc /网/ xt_qtaguid /统计数据。
I search the questions. It seems that they can read the /proc/net/xt_qtaguid/stats with out nullpointerexception.
但是,当我读到这个文件它关闭虚拟机并报告显示java.lang.NullPointerException
But when I read this file it shut down the vm and report a java.lang.nullpointerexception
任何人都可以成功读取此文件?
can anyone succeed to read this file?
更新:Actualy,我可以通过
update: Actualy, I can read this file through
Runtime.getRuntime().exec("cat /proc/net/xt_qtaguid/stats")
或
BufferedReader in = new BufferedReader(new FileReader("/proc/net/xt_qtaguid/stats"));
该NullPointerException异常是投由于我不小心把未初始化的String []
The nullpointerexception is cast due to my careless to use an uninitialized String[]
推荐答案
如果你不是系统无法读取该文件。有这些文件保护,仅是通过系统UID入店的角度来看的原因。
You cannot read this file if you are not system. There is a reason these files are protected from the perspective of only being accesible by system uid.
这篇关于在我的用户应用程序读取的/ proc /净/ xt_qtaguid /统计,造成显示java.lang.NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!