0

I have an application which performs various file system operations. There is a high-level exception handler which checks for an IOException to see if it is an out of disk space error, notifies the user to free up disk space, and allows them to continue whatever they were doing. The exception handler code has no knowledge about what file operations were executed by the lower-level code. The IOException does not appear to provide any details regarding which drive or UNC share is out of space. Is there any way I can retrieve this info so the user can know where they need to free up space?

Steve
  • 165
  • 1
  • 13
  • http://stackoverflow.com/questions/1393711/get-free-disk-space – MethodMan May 12 '17 at 13:15
  • Either iterate through all drives and see which one is low on space or log file operations or keep track of file paths as you use them. – xxbbcc May 12 '17 at 13:22
  • My question is specifically how to determine the drive from the exception. – Steve May 12 '17 at 13:55
  • That just not how error reporting works on Windows. It assumes that you already know which drive has this problem since your program supplied the path name of the file. If you have no idea what it could be, hard to guess why, then consider using the Path.GetFullPath() method. – Hans Passant May 12 '17 at 14:27

0 Answers0