$disk » History » Version 4
Per Amundsen, 08/10/2015 09:00 AM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$disk(path|N)* |
||
4 | |||
5 | Returns information about the specified hard disk, where N = 0 for total available drives, and N > 0 to access each drive. |
||
6 | |||
7 | If no properties is defined, returns [[$true]] if hard disk exists, else [[$false]]. |
||
8 | |||
9 | 3 | Per Amundsen | _$disk with no parameters in /sysinfo [N:] and /diskinfo [N:] will return the drive letter [N:] used as parameter._ |
10 | 1 | Per Amundsen | |
11 | *Parameters* |
||
12 | |||
13 | 4 | Per Amundsen | path|N - The hard disk letter (C:) or the Nth hard disk. |
14 | 1 | Per Amundsen | |
15 | *Properties* |
||
16 | |||
17 | .type - Type of hard disk. (unknown, norootdirectory, removable, fixed, network, cdrom, ram) |
||
18 | .free - Number of free bytes available. |
||
19 | .label - Label of the hard disk. |
||
20 | .size - Total number of bytes. |
||
21 | 4 | Per Amundsen | .unc - The "UNC":https://en.wikipedia.org/wiki/Uniform_Naming_Convention path for a network drive. (\\x.x.x.x\dir) |
22 | 1 | Per Amundsen | .path - The hard drive letter/path (C:\) |
23 | |||
24 | *Examples* |
||
25 | |||
26 | <pre> |
||
27 | 4 | Per Amundsen | ; Print total number of hard drives. |
28 | 1 | Per Amundsen | echo -ag Total number of hard drives is $disk(0) |
29 | |||
30 | 4 | Per Amundsen | ; Print some hard drive info of the first drive. |
31 | 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. |
32 | </pre> |