$disk » History » Version 10
Per Amundsen, 02/16/2023 09:26 PM
| 1 | 1 | Per Amundsen | _Added in 1.9.0_ |
|---|---|---|---|
| 2 | |||
| 3 | 7 | Per Amundsen | *$disk* |
| 4 | |||
| 5 | In /sysinfo [N:] and /diskinfo [N:] will return the drive letter [N:] used as parameter. |
||
| 6 | |||
| 7 | 9 | Per Amundsen | If the [N;] parameter is not defined, $disk will return [[$null]]. |
| 8 | 8 | Per Amundsen | |
| 9 | 7 | Per Amundsen | ---------------------------- |
| 10 | |||
| 11 | _Added in 1.9.0_ |
||
| 12 | |||
| 13 | 1 | Per Amundsen | *$disk(path|N)* |
| 14 | |||
| 15 | Returns information about the specified hard disk, where N = 0 for total available drives, and N > 0 to access each drive. |
||
| 16 | |||
| 17 | 5 | Per Amundsen | If no properties is defined, returns [[$true]] if hard disk exists, otherwise [[$false]]. |
| 18 | 1 | Per Amundsen | |
| 19 | 6 | Per Amundsen | _[[$disk]] with no parameters in /sysinfo [N:] and /diskinfo [N:] will return the drive letter [N:] used as parameter._ |
| 20 | 1 | Per Amundsen | |
| 21 | *Parameters* |
||
| 22 | |||
| 23 | 10 | Per Amundsen | table(ktable). |
| 24 | |*Parameter*|*Description*| |
||
| 25 | | path<notextile>|</notextile>N | The hard disk letter (C:) or the Nth hard disk. | |
||
| 26 | 1 | Per Amundsen | |
| 27 | *Properties* |
||
| 28 | |||
| 29 | 10 | Per Amundsen | table(ktable). |
| 30 | |*Property*|*Description*| |
||
| 31 | | .type | Type of hard disk. (unknown, norootdirectory, removable, fixed, network, cdrom, ram) | |
||
| 32 | | .free | Number of free bytes available. | |
||
| 33 | | .label | Label of the hard disk. | |
||
| 34 | | .size | Total number of bytes. | |
||
| 35 | | .unc | The "UNC":https://en.wikipedia.org/wiki/Uniform_Naming_Convention path for a network drive. (\\x.x.x.x\dir) | |
||
| 36 | | .path | The hard drive letter/path (C:\) | |
||
| 37 | 1 | Per Amundsen | |
| 38 | *Examples* |
||
| 39 | |||
| 40 | <pre> |
||
| 41 | 4 | Per Amundsen | ; Print total number of hard drives. |
| 42 | 1 | Per Amundsen | echo -ag Total number of hard drives is $disk(0) |
| 43 | |||
| 44 | 4 | Per Amundsen | ; Print some hard drive info of the first drive. |
| 45 | 1 | Per Amundsen | echo -ag The first hard drive is $bytes($disk(1).size).suf in size and have $bytes($disk(1).free).suf free space. |
| 46 | </pre> |