finding_20the_20free_20space_20on_20a_20disk
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
finding_20the_20free_20space_20on_20a_20disk [2018/03/31 13:19] – external edit 127.0.0.1 | finding_20the_20free_20space_20on_20a_20disk [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
//by Richard Russell, October 2006//\\ \\ If you need to find out the amount of free space on a disk drive you can do that quite easily:\\ \\ | //by Richard Russell, October 2006//\\ \\ If you need to find out the amount of free space on a disk drive you can do that quite easily:\\ \\ | ||
+ | <code bb4w> | ||
drive$ = " | drive$ = " | ||
SYS " | SYS " | ||
gbytes_total = SpC% * BpS% * Total% / 2^30 | gbytes_total = SpC% * BpS% * Total% / 2^30 | ||
gbytes_free | gbytes_free | ||
+ | </ | ||
This code fragment sets **gbytes_total** to the total capacity of the drive and **gbytes_free** to the free (unused) space on the drive, both in Gigabytes.\\ \\ If you only want to know the free space as a percentage of the total you don't need to calculate the values in Gbytes but simply use the **Free%** and **Total%** values:\\ \\ | This code fragment sets **gbytes_total** to the total capacity of the drive and **gbytes_free** to the free (unused) space on the drive, both in Gigabytes.\\ \\ If you only want to know the free space as a percentage of the total you don't need to calculate the values in Gbytes but simply use the **Free%** and **Total%** values:\\ \\ | ||
+ | <code bb4w> | ||
PRINT "The disk has "; | PRINT "The disk has "; | ||
+ | </ |
finding_20the_20free_20space_20on_20a_20disk.1522502360.txt.gz · Last modified: 2024/01/05 00:17 (external edit)