Win32::DriveInfo - drives on Win32 systems
PerlからCDROMのドライブレターを取得する方法を探していたら、こんなのを発見した。目的は達せそうですが、ドライブレター決めうちじゃないとだめなのか...
use Win32::DriveInfo; ($VolumeName, $VolumeSerialNumber, $MaximumComponentLength, $FileSystemName, @attr) = Win32::DriveInfo::VolumeInfo('g');
いや、ちがう。さすがにそんなタコなしようじゃなかったようだ。:-)
drive - drive-letter in either 'c' or 'c:' or 'c:\\' form. $VolumeName - name of the specified volume. $VolumeSerialNumber - volume serial number. $MaximumComponentLength - filename component supported by the specified file system. A filename component is that portion of a filename between backslashes. Indicate that long names are supported by the specified file system. For a FAT file system supporting long names, the function stores the value 255, rather than the previous 8.3 indicator. Long names can also be supported on systems that use the New Technology file system (NTFS). $FileSystemName - name of the file system (such as FAT, FAT32, CDFS or NTFS). @attr - array of integers 1-6 1 - file system preserves the case of filenames 2 - file system supports case-sensitive filenames 3 - file system supports Unicode in filenames as they appear on disk 4 - file system preserves and enforces ACLs (access-control lists). For example, NTFS preserves and enforces ACLs, and FAT does not. 5 - file system supports file-based compression 6 - specified volume is a compressed volume; for ex., a DoubleSpace volume