Free Disk Space on drive
-
- Enthusiast
- Posts: 356
- Joined: Thu Jul 02, 2009 5:42 am
Free Disk Space on drive
Is there anyway to get the free disk space on the hard drive?
Re: Free Disk Space on drive
Yes there is... 
attributesOfFileSystemForPath:error:

attributesOfFileSystemForPath:error:
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
-
- Enthusiast
- Posts: 356
- Joined: Thu Jul 02, 2009 5:42 am
Re: Free Disk Space on drive
I did a search in the help file for attributesOfFileSystemForPath:error: but could not find it 

Re: Free Disk Space on drive
It won't be in the PureBasic help file, it's Cocoa.spacebuddy wrote:I did a search in the help file for attributesOfFileSystemForPath:error: but could not find it
https://www.google.com/search?client=sa ... 8&oe=UTF-8
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
-
- Enthusiast
- Posts: 356
- Joined: Thu Jul 02, 2009 5:42 am
Re: Free Disk Space on drive
Okay I tried this but I keep getting 0 bytes back
Global attr = CocoaMessage(0, CocoaMessage(0, 0, "NSFM"), "attributesOfFileSystemForPath:error")
bytesFree=CocoaMessage(0,attr,"objectForKey:NSFileSystemFreeSize")
Global attr = CocoaMessage(0, CocoaMessage(0, 0, "NSFM"), "attributesOfFileSystemForPath:error")
bytesFree=CocoaMessage(0,attr,"objectForKey:NSFileSystemFreeSize")
Re: Free Disk Space on drive
Code: Select all
Define FreeSize.q
Define FileManager = CocoaMessage(0, 0, "NSFileManager defaultManager")
Define Attributes = CocoaMessage(0, FileManager, "attributesOfFileSystemForPath:$", @"/", "error:", #nil)
CocoaMessage(@FreeSize, CocoaMessage(0, Attributes, "objectForKey:$", @"NSFileSystemFreeSize"), "longLongValue")
Debug FreeSize
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
- Enthusiast
- Posts: 356
- Joined: Thu Jul 02, 2009 5:42 am
Re: Free Disk Space on drive
Thanks wilbert 
