如何获得一个文件的扇区号 [英] How to get sector numbers of a file

查看:619
本文介绍了如何获得一个文件的扇区号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发Android应用程序(通过JNI的Andr​​oid UI和C应用程序)和文件系统EXT4是

We are developing Android application (Android UI and C application through JNI) and File system is ext4.

是否有任何Linux系统调用或Android API来找出分配给文件扇区数。

Is there any Linux system call or Android API to find out sector numbers allocated for a file.

请分享您的想法。

推荐答案

您好:您可以使用stat命令获取文件块和更多信息。

Hello you can get the file blocks and more information using stat command.

统计[OPTIONS] ... FILE ...

stat [OPTIONS]... FILE ...

例如,你可以知道这样的my.cnf的信息:

For example you could know the info about my.cnf like this:

/etc/my.cnf中

stat /etc/my.cnf

您可以使用该选项来获得不同的格式序列单独使用--help选项文件。

You can use the options to get different format sequences for files using the --help option alone.

这篇关于如何获得一个文件的扇区号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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