【问题标题】:statfs /storage/sdcard0 failed, errno: 13statfs /storage/sdcard0 失败,错误号:13
【发布时间】:2013-10-11 17:08:41
【问题描述】:

在 logcat 中收到此错误并带有非法参数异常

statfs /storage/sdcard0 失败,错误号:13

我的代码是

public double totalStorage() throws Exception {


        **stat = new StatFs(Environment.getExternalStorageDirectory().getPath());**
        return ((double) stat.getBlockSize()
                * (double) stat.getBlockCount());
    }

请帮忙

【问题讨论】:

    标签: android


    【解决方案1】:

    Errno 13 表示“权限被拒绝”,表示您的权限不足。

    【讨论】:

    • 那么我怎样才能获得特权......以及我们怎样才能得到一个列表来显示错误号的问题。
    • 我已经添加了权限,现在它没有抛出任何异常。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-07
    • 2021-03-02
    • 1970-01-01
    • 2021-09-07
    相关资源
    最近更新 更多