FiberOPtics commented on a Page, Easy Disk Information  -  Jan 14, 2006

You can simplify your looping process if you start at var %i = 1 and loop through $disk(%i), since $disk accepts either a name like c: or a number N which represents the N\'th drive. Let me illustrate:

var %i = 1
while (!$disk(%i)) inc %i
; stuff with $disk(%i).[property]

But anyway, once again there is a fundamental design flaw in this, because if you have a floppy inserted in your a: drive, then it will return stats about this floppy drive instead of your c: drive.

Furthermore, as in my case, you may have disk partitions, of which we won\'t get to see any statistics with your code, only of the first partition.

It would be much more convenient, if you made an identifier that takes as parameter the path to the drive, such as c or d, and that your snippet returns the same stats as now, but for the specified drive.

In other words $diskstats() instead of just $diskstats.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.