可能是检测程序不同步,两次检测之间磁盘数据有变化。
用API试试:
DECLARE LONG GetDiskFreeSpace IN Kernel32 STRING@, LONG@, LONG@, LONG@, LONG@
cRootPathName = "C:"
nSectorsPerCluster = 0
nBytesPerSector = 0
nNumberOfFreeClusters = 0
nTotalNumberOfClusters = 0
GetDiskFreeSpace(@cRootPathName, @nSectorsPerCluster, @nBytesPerSector,;
@nNumberOfFreeClusters, @nTotalNumberOfClusters)
? cRootPathName
? "已用空间: "+PADL((nTotalNumberOfClusters-nNumberOfFreeClusters)*nSectorsPerCluster*nBytesPerSector,20," ")
? "可用空间: "+PADL(nNumberOfFreeClusters*nSectorsPerCluster*nBytesPerSector,20," ")
? "---------------------------------------------"
? "磁盘容量: "+PADL(nTotalNumberOfClusters*nSectorsPerCluster*nBytesPerSector,20," ")