trancexx Posted December 18, 2011 Share Posted December 18, 2011 trancexx, I get these values - Vista x32 if that makes any difference: Drive C: M: DriveSpaceTotal = 253 549 992 187 99 999 996 093 His correction = 265 866 436 608 104 857 555 404 Windows = 265 866 436 608 104 857 595 404 The first 2 values come from the OP's code, the Windows values are those given by selecting the drive in Explorer and looking at the Properties dialog. M23 What are the units of numbers displayed in properties dialog? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2011 Moderators Share Posted December 18, 2011 (edited) trancexx, 265,866,436,608 bytes 247 GB M23 And I see the OP has still not amended the title. Edited December 18, 2011 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trancexx Posted December 18, 2011 Share Posted December 18, 2011 (edited) trancexx, 265,866,436,608 bytes 247 GB M23 And I see the OP has still not amended the title. But you said OP's results are correct (being what your properties say). For your drives AutoIt will report: ConsoleWrite("AutoIt says " & DriveSpaceTotal("C:") * 1024 * 1024 & " bytes" & @CRLF) ConsoleWrite("AutoIt says " & DriveSpaceTotal("M:") * 1024 * 1024 & " bytes" & @CRLF) And that should be exactly what properties box says. Edited December 18, 2011 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2011 Moderators Share Posted December 18, 2011 trancexx,It does. So if I understand correctly the OP was making the 1000/1024 error in his initial calculation of the returned MB value from DriveSpaceTotal and correctly calculating it for the "corrected" value. Or have I misunderstood again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trancexx Posted December 18, 2011 Share Posted December 18, 2011 Help file creates a confusion. More correct would be to say Returns the total disk space of a path in Mebibytes.But then it would be "Is drive space storage space or memory space?"All in all, DriveSpaceTotal should simply return bytes. Then there wouldn't be any confusion. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Chimaera Posted December 18, 2011 Share Posted December 18, 2011 Returns the total disk space of a path in Mebibytes.Is that the same as a Maybebyte ? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2011 Moderators Share Posted December 18, 2011 Chimaera, I think that is what I have been using for many years now if this thread is anything to go by! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trancexx Posted December 18, 2011 Share Posted December 18, 2011 Mebi it is, mebi it's not. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Spiff59 Posted December 19, 2011 Share Posted December 19, 2011 (edited) Speaking of math classes... doesn't your "conversion" : $HDspace = DriveSpaceTotal("c:") $hdspace = $hdspace * 1000000 $hdspace = $hdspace/1024 $hdspace = $hdspace/1000000 $hdspace = $hdspace*1024*1024*1024 $hdspace = $hdspace/1000000 boil down to : $hdspace = DriveSpaceTotal("c:") * 1.024 * 1.024 Just a basic KB=1000 to KB=1024 conversion... haven't been dealing with those for 30 years <cough> Edit: Of course that formula only works for drives in the MB range. Dig your old 500KB drive out of the box in the basement, or break the TB threshhold, and it would report incorrectly. You'd need a function containing a loop to handle any value... Global $BytesReported = DriveSpaceTotal("C:") * 1000000 Global $BytesActual = DriveSpaceAdjusted($BytesReported) MsgBox(0,"","Btyes Reported: " & $BytesReported & @CRLF & "Btyes Actual: " & $BytesActual) Func DriveSpaceAdjusted($in) Local $out = $in $in /= 1000 ; no conversion for last 3 decimal places While $in > 1000 $in /= 1000 $out *= 1.024 WEnd Return $out EndFunc Since, for me, Windows reports 640+ million bytes and 596MB, the 610+ million number returned by DriveSpaceTotal() seems of little use. So, I agree with your premise about the need for a change, but your delivery certainly isn't scoring you any points Edited December 19, 2011 by Spiff59 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now