File::isOnHardDisk issue with unreachable network


#1

Hi !


I have a problem with File::isOnHardDisk() with file path like this:

\\192.168.9.151\Users\alex

In the common case,  it's returning the expected false value.

But if I unplug my network cable, it's returning true !

 

This is due to the DRIVE_NO_ROOT_DIR value returned by getWindowsDriveType() in this case.

So I fix it by modifying the last line of isOnHardDisk() like this:

return n != DRIVE_CDROM && n != DRIVE_REMOTE && n != DRIVE_NO_ROOT_DIR;


Thanks for your concern about this.


#2

Thanks! That's certainly an edge-case that our unit-tests wouldn't have included! Will take a look..


#3

Thanks again for your reactiviy.