⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 freespace.tex

📁 LPC2142 做MP3的源程序
💻 TEX
字号:
\hyphenation{count-Free-Clusters File-System}To get the free space left on EFSL 0.2 is a bit tricky. Thisfeature was implemented after it had gone into stable, so itcouln't interfere with other library functions.If the filesystem type is FAT12 of FAT16, you must call\\\code{euint32 fat\_countFreeClusters (FileSystem *fs)} to knowthe amount of free clusters. Please note that this is an expensivefunction call in terms of speed. It will also work on FAT32 volumes,but there is a better alternative for that.Usually FAT32 volumes are substantially larger than FAT12 of FAT16 volumes.Microsoft, in it's infinite wisdom, decided to use the second sector ofthe partition to dump various statistics about the filesystem. Problemis they are inaccurate, so if you want to be really sure, always use thebeforementioned countFreeClusters function.To save time, you can also use \code{esint8 fs\_getFsInfo(FileSystem *fs,euint8 force\_update)}.If force\_update is set to 0, this function will simply gather the datathat is stored on the disc regarding free space. If you call it withforce\_update set to 1, it will gather this data, but correct the resultwith a call to countFreeClusters.After that you will find the result in fs->FreeClusterCount.To save time, call getFsInfo after you mounted the filesystem,and just before you umount the filesystem give a call to setFsInfo.This will make the updated clustercount get written to disc, so youdon't have to go through the lenghty verification everytime.The functions that have the largest impact on free space (allocClusterChainand unlinkClusterChain) keep track of the changes they make and they updatethe fs->FreeClusterCount field accordingly.This is an ugly ``add-on'', and will be replaced by a decent implementationin the 0.3/0.4 series.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -