Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API call to find space on disc 1

Status
Not open for further replies.

Sylviaom

Programmer
Oct 6, 2004
1
GB
I am trying to update a simple backup prog. Does anyone know of an API call to find how much space is left on the backup cd the prog is writing to? I have searched thru' the MSDN help, but so far not found an answer, I bet it's there somewhere! I just want to continue with a save if enough space is available or eject the disc if there isn't. TIA for any answer or pointer to another thread.
 
See GetDiskFreeSpaceEx() in MSDN:
Code:
BOOL GetDiskFreeSpaceEx(
  LPCTSTR lpDirectoryName, // pointer to the directory name
  PULARGE_INTEGER lpFreeBytesAvailableToCaller, // receives
                           // the number of bytes on
                           // disk available to the caller
  PULARGE_INTEGER lpTotalNumberOfBytes,  // receives
                     //  the number of bytes on disk
  PULARGE_INTEGER lpTotalNumberOfFreeBytes // receives
                             // the free bytes on disk
);
Type PULARGE_INTEGER is __int64 MS C/C++ 64-bit type (MS specific extension!).
Be careful: this API is available on Windows 95 systems beginning with OEM Service Release 2 (OSR2).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top