mIRC Homepage
Posted By: westor $disk(N).tech - 07/01/16 02:57 PM
Hello,

It would be nice to add an property to return if the drive is SSD or HDD technology.

Usage: $disk(N).tech

Example: //echo -a My Drive technology is: $disk(C:).tech

Results: My Drive technology is: SSD

- Thanks!
Posted By: FreeTrav Re: $disk(N).tech - 08/01/16 12:04 AM
Unfortunately, there is no reliable way of obtaining this information. SSDs are currently designed to appear to the OS and applications as regular HDDs, operationally, and not all SSDs include the string "SSD" in their internal model identification strings.

Why do you feel mIRC needs to know the disk technology?
Posted By: westor Re: $disk(N).tech - 08/01/16 12:48 PM
First of all there is a way to detect just google it and you will find a lot of code samples (C# or C++).

https://www.google.gr/?gfe_rd=cr&ei=pK6PVpmLLdSz8weTtZeIDg&gws_rd=ssl#q=wmi+ssd+detect

Your question about why i want to know if it is an SSD or HDD does not make sense, if you are scripter you can think why someone want something new to be added, in few words there no why its just an feature.
Posted By: FroggieDaFrog Re: $disk(N).tech - 08/01/16 12:56 PM
First, there isn't a clear-cut way to determine if a drive is SSD. If you would have looked at your own search results, all link back to a hack of testing rotation speed(reported as 1 for SSD but HDD drives can also return as such) and checking if there's a delay when seeking.

Windows, afaict, does not expose an object/member that specifically says "this drive is SSD".

--

As far as your actual request, what value does it add to mSL as a language?
Posted By: westor Re: $disk(N).tech - 08/01/16 01:06 PM
First, there is a way to determine, if there will be not a way explain why other programs can detect with succeed the disk drive technology, i can not give you a C# or C++ code here because i am not related with them i don't know if there must be a hacking or an super NASA extra dll to detect it but i know that there is a way.

I know that the Windows does not expose an object/member that return if it is SSD or not that's why i post the link before to give you some websites with some example codes that you can see and understand better than me.

About the value, the same value as the .unc properity in the $disk identifier whistle
Posted By: argv0 Re: $disk(N).tech - 08/01/16 08:39 PM
You posted those links and then were told that the methods used in those links are not reliable.

Simply put, there is no reliable way to determine if a HDD is SSD or not, the existence of C code to approximate it does not prove that there is. If anything, it highlights the lack of accurate detection mechanisms. I would suggest listening to the people in this forum when they adamantly inform you that something is not possible in a reliable way.

As for $disk().unc, that is a supported part of the Windows API, completely unrelated in functionality and methodology to SSD. I don't see any value to knowing if a disk is SSD or not-- there is, however, value in knowing the network path of a connected disk (since that's the only way to access it).
Posted By: Wims Re: $disk(N).tech - 08/01/16 09:03 PM
Certainly if you don't see any value in this, westor, him, sees the value.

In it's simplest form, the value would be the same as knowing the size of the disk. It could be used for display purpose, like general stats about disks.
As far as more elaborated scenarios are concerned, it is explained in a stackoverflow link (unsure if it's the one posted here) that they wanted to know if it's an SSD, to eventually load objects in a map in a different way, I think it's a valid point, you are loading the objects from files on the disk and perhaps you want to load them all if it's SSD, or load them 'later' if it's not.

Not the best feature we need, but not the worst, if tomorrow there is a reliable way to know if a disk is SSD or not, it would simply improve $disk imo.
Posted By: westor Re: $disk(N).tech - 08/01/16 11:09 PM
Lets finish this conversation and left the build and decide progress to the developer, if you thing that there is not a way ok its your opinion in my opinion guys i think there is a way so we will never have an agreement about it, i agree with @Wims post but anyway, i will attach an C# or C++ (i am not related with it) code that maybe help to this because 'some' said that there is not a way or there is but is an 'wrong' way. also it would be good if @Khaled could give a final answer on this.

Example Founded Code: http://pastebin.com/CEu3D4SE

- Thanks!
Posted By: argv0 Re: $disk(N).tech - 09/01/16 01:49 AM
Originally Posted By: westor
i will attach an C# or C++ (i am not related with it) code that maybe help to this because 'some' said that there is not a way or there is but is an 'wrong' way


No. You're not reading. Nobody said there is no way to do it. They had said that there is no reliable way to do it. Note that this important keyword was even italicized for importance in the first reply. I've bolded and underlined it for even more distinction.

The code you once again posted is not reliable. It makes assumptions about how disks work that are not always accurate. Simply put, it is guessing. As pointed out, it will occasionally guess wrong. A script that used this would occasionally be wrong. Occasionally can be more scenarios than you think, but one practical one would be any drive setup in a RAID array. This is not an opinion, it is a fact.

We should not have unreliable functions in mIRC. That is an opinion (alongside the one where there is no point for this), but it is also an opinion that carries quite a bit of precedent with it. If a routine is going to make guesses, it should be your userland script, not a core function of mIRC.
Posted By: TRT Re: $disk(N).tech - 09/01/16 12:10 PM
Things like this will never get implemented when there is no API offered by the underlying OS.
© mIRC Discussion Forums