mIRC Home    About    Download    Register    News    Help

Print Thread
#256297 07/01/16 02:57 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #256302 08/01/16 12:04 AM
Joined: Sep 2011
Posts: 32
F
Ameglian cow
Offline
Ameglian cow
F
Joined: Sep 2011
Posts: 32
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?

FreeTrav #256305 08/01/16 12:48 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #256306 08/01/16 12:56 PM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
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?

Last edited by FroggieDaFrog; 08/01/16 12:57 PM.

I am SReject
My Stuff
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #256309 08/01/16 08:39 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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).


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #256310 08/01/16 09:03 PM
Joined: Jul 2006
Posts: 4,185
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,185
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #256312 08/01/16 11:09 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #256313 09/01/16 01:49 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
westor #256314 09/01/16 12:10 PM
Joined: Jun 2003
Posts: 81
T
TRT Offline
Babel fish
Offline
Babel fish
T
Joined: Jun 2003
Posts: 81
Things like this will never get implemented when there is no API offered by the underlying OS.


Link Copied to Clipboard