DiskSpace and PB 3.1

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

DiskSpace and PB 3.1

Post by BackupUser »

Code updated for 5.20+

Restored from previous forum. Originally posted by freak.

Some time ago, I posted some code to get the total/used/free disk space.
Now I tested it again, and it doesn't work with PB 3.1 (becouse of Changes on
the '>>' command.)

So, here's a new one, that works:

Code: Select all

; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  
drive.s = "C:\"
  
GetDiskFreeSpaceEx_(@drive, @FB.q, @TB.q, @TFB.q)

MessageRequester("Disk Size", "Space Total: " + Str(TB) + " MB" + Chr(13) + "Space Free: " + 
                  Str(TFB) + " MB" + Chr(13) + "Space Used: " + Str(TB - TFB) + " MB")

End
  
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Everybody who used the old one should replace it, becouse it returns completly wrong values.

That's it...

Timo

--

A debugged program is one for which you have not yet found the conditions that make it fail.


Edited by - freak on 02 June 2002 16:48:04