iPhone中获取磁盘空间方法
来源:互联网 发布:奥迪tt知乎 编辑:程序博客网 时间:2024/04/28 20:03
方法1,使用statfs:
A quick Internet search to find out how to get the disk space on a device showed a number of blog posts that proposed solutions similar to this:
This approach relies on the handy Unix statfs() function that provides the required file system information. I coded it up and it worked on my 3.x devices. Fine I thought, I’m off and running. Then when testing on a 2.x device, it crashed. The problem looks to be differences in the compiler settings between the two OS versions. Rather than figure that out (I leave that as an exercise to the reader ), I continued my search and came across what I consider the “correct” solution since it uses the iPhone SDK itself, as given below.
As stated in the documentation, these interfaces wrapper the statfs() function, so they ultimately do the same thing, but they have been a part of the SDK since version 2.0! Testing verified my assumption and this approach works for me on my 2.x and 3.x devices and the numbers match what iTunes shows as well
From: http://iphoneincubator.com/blog/device-information/how-to-obtain-total-and-available-disk-space-on-your-iphone-or-ipod-touch
- iPhone中获取磁盘空间方法
- iPhone获取磁盘空间正规方法
- 获取iPhone 剩余磁盘空间-全部磁盘空间
- 获取 iPhone 剩余磁盘空间的代码
- iphone中获取屏幕分辨率的方法
- IPhone中获取文件各项属性方法
- C#获取磁盘空间信息的几个方法
- Delphi实现获取磁盘空间大小的方法
- TSQL方法获取服务器磁盘空间信息
- C#实现获取磁盘空间大小的方法
- 获取磁盘空间
- iphone中获取文件路径的4种方法
- iPhone中获取UIWebView内的html方法
- iphone中获取文件路径的4种方法
- iphone中获取文件路径的4种方法
- 获取IPhone相册中图片的方法(ASSets)
- 在Golang中获取系统的磁盘空间内存占用
- 获取IPhone相册中图片的方法(包括获取所有图片)
- poj 2828 线段树,思路跟 3667hotel差不多. 感觉比那个简单一点 由此说明. hotel 是十分经典到的有区间里面讨论的线段树
- 人为什么会痛苦?
- windows核心编程第六章--线程
- Android线程学习
- linux环境sqlplus中使用backspace 及 方向键
- iPhone中获取磁盘空间方法
- sizeof
- 基于EfsFrame框架的主从表操作(查询、修改、删除)
- 如何判断一个操作系统是16位还是32位的?不能用sizeof()函数
- 2010年8月25日
- Ajax+jQuery 实现菜单联动
- 在LINUX下 编译ORACLE OCCI接口应用程序
- Android应用程式编译成系统程序
- [转]boost::asio::ip::tcp实现网络通信的小例子