I had a variable that bothered elsewhere in my code, it works perfectly now
Thank you very much for your help: D
Getting Free Disk Space
Re: Getting Free Disk Space
Hi everybody.
I tried this code but when I call "GetDiskFreeSpaceEx_()" I get the error: "GetDiskFreeSpaceEx_() is not a function, array, list, map or macro".
Perhaps this code is not valid in current version of PureBasic?
Thanks in advance!!
I tried this code but when I call "GetDiskFreeSpaceEx_()" I get the error: "GetDiskFreeSpaceEx_() is not a function, array, list, map or macro".
Perhaps this code is not valid in current version of PureBasic?
Thanks in advance!!
Regards,
JT
JT
Re: Getting Free Disk Space
Thanks you for you fast answer, but I'm using the full version of PureBasic, not trial.RASHAD wrote:PureBasic demo version don't support Windows API calls
Regards,
JT
JT
Re: Getting Free Disk Space
GetDiskFreeSpaceEx() is a Windows API function, and will not work on MacOS or Linux. This example includes MacOS API calls for similar functionalities:JoseT wrote:...when I call "GetDiskFreeSpaceEx_()" I get the error: "GetDiskFreeSpaceEx_() is not a function, array, list, map or macro".
Code: Select all
Define.q availableSize, totalSize, freeSize
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
GetDiskFreeSpaceEx_("C:", @availableSize, @totalSize, @freeSize)
CompilerElseIf #PB_Compiler_OS = #PB_OS_MacOS
fm = CocoaMessage(0, 0, "NSFileManager defaultManager")
fs = CocoaMessage(0, fm, "attributesOfFileSystemForPath:$", @"/", "error:", #nil)
sz = CocoaMessage(0, fs, "objectForKey:$", @"NSFileSystemSize")
fs = CocoaMessage(0, fs, "objectForKey:$", @"NSFileSystemFreeSize")
CocoaMessage(@freeSize, sz, "longLongValue")
CocoaMessage(@totalSize, fs, "longLongValue")
CompilerEndIf
Debug "Total: " + FormatNumber(totalSize, 0) + " bytes"
Debug "Free: " + FormatNumber(freeSize, 0) + " bytes"
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
Re: Getting Free Disk Space
Finally, this problem was solved with reinstallation of PB. I think you are right, my installation was corrupted, I supose.JoseT wrote:Thanks you for you fast answer, but I'm using the full version of PureBasic, not trial.RASHAD wrote:PureBasic demo version don't support Windows API calls
Thaks a lot!
Regards,
JT
JT