Code example for StatFs

Methods: getAvailableBlocks, getBlockSize

0
	 *            检查的路径路径 
	 * @return 在字节的可用空间 
	 */ 
	public static long getUsableSpace(File path)
	{ 
		final StatFs stats = new StatFs(path.getPath());
		return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
	} 
 
	/** 
	 * 获得外部应用程序缓存目录 
	 *  
	 * @param context 
	 *            上下文信息 
	 * @return 外部缓存目录 
	 */ 
	public static File getExternalCacheDir(Context context)
	{ 
		final String cacheDir = "/Android/data/" + context.getPackageName()
				+ "/cache/"; 
		return new File(Environment.getExternalStorageDirectory().getPath()