wxGetDiskSpace

From WxWiki
Jump to: navigation, search

Description

Function to return the available disk space.

Warning: Bug in Windows 98

wxGetDiskSpace() ''may'' return an error when asked for the free space in a perfectly valid directory with plenty of space available. This can happen if the first letter of one of the directory components is a '.', as is commonly used for preference settings under linux. ''You can't create directories named that way using windows explorer, but you can from the DOS prompt and also programmatically''

The bug is in the underlying windows api function

GetFreeDiskSpaceExA()

which is broken - you'll see a 0x7b, indicating bad path or other error - if you have a debug console.

Testing the error return of wxGetDiskSpace will at least tell you that something is awry. On Windows 98 there are no per-directory quotas so it would be possible to try again with just the drive letter in that case.