首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Perl获取硬盘信息

使用Perl获取硬盘信息
EN

Stack Overflow用户
提问于 2010-08-19 07:17:04
回答 4查看 3.7K关注 0票数 5

我想使用perl检查上的硬盘空间,有什么方法吗?

诚挚的问候,

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2010-08-19 07:22:01

请参阅Win32 32::DriveInfo

代码语言:javascript
运行
复制
($SectorsPerCluster, $BytesPerSector, $NumberOfFreeClusters, 
$TotalNumberOfClusters, $FreeBytesAvailableToCaller, $TotalNumberOfBytes, $TotalNumberOfFreeBytes) =  Win32::DriveInfo::DriveSpace( drive );

   $SectorsPerCluster          - number of sectors per cluster.
   $BytesPerSector             - number of bytes per sector.
   $NumberOfFreeClusters       - total number of free clusters on the disk.
   $TotalNumberOfClusters      - total number of clusters on the disk.
   $FreeBytesAvailableToCaller - total number of free bytes on the disk that
                                 are available to the user associated with the
                                 calling thread, b.
   $TotalNumberOfBytes         - total number of bytes on the disk, b.
   $TotalNumberOfFreeBytes     - total number of free bytes on the disk, b.
票数 6
EN

Stack Overflow用户

发布于 2010-08-19 08:35:38

大多数情况下,像Filesys::DfPortable这样的可移植解决方案是更好的选择。认识到成为虚度懒惰的机会。

票数 8
EN

Stack Overflow用户

发布于 2010-08-19 07:20:54

Win32驱动器信息应该能做到这一点。

我猜你是在找

$TotalNumberOfFreeBytes

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3519575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档