Quantcast

Fixing bug 39915 (DriveInfo.VolumeLabel does not return Volume Label under Windows)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fixing bug 39915 (DriveInfo.VolumeLabel does not return Volume Label under Windows)

HKakuschke
Hi,

as I recently also suffered from Bug 39915 under Windows OS, I would like to
fix that.

Handling volume labels under Windows OS could be done via Windows API
functions GetVolumeInformation() and SetVolumeLabel() respectively (like
getting DriveInfo.TotalFreeSpace is handled via Windows API function
GetDiskFreeSpace()).

But, I just don't have any idea how to write test cases for this:
- to test the getter of DriveInfo.VolumeLabel one would need to know the
volume labels of the drives of the test machine
- to test the setter of DriveInfo.VolumeLabel one would have to alter the
volume label of at least one of the drives of the test machine.

Any suggestions or ideas?

Thanks,
Horst



--
View this message in context: http://mono.1490590.n4.nabble.com/Fixing-bug-39915-DriveInfo-VolumeLabel-does-not-return-Volume-Label-under-Windows-tp4670441.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fixing bug 39915 (DriveInfo.VolumeLabel does not return Volume Label under Windows)

Rafael Teixeira
You could start a process (console) and capture the standard output, and in it call 'dir'. It is convoluted but I do it frequently for testing interactions between multiple processes.

Rafael Teixeira
O..:.)oooo

On Fri, Apr 7, 2017 at 10:28 AM, HKakuschke <[hidden email]> wrote:
Hi,

as I recently also suffered from Bug 39915 under Windows OS, I would like to
fix that.

Handling volume labels under Windows OS could be done via Windows API
functions GetVolumeInformation() and SetVolumeLabel() respectively (like
getting DriveInfo.TotalFreeSpace is handled via Windows API function
GetDiskFreeSpace()).

But, I just don't have any idea how to write test cases for this:
- to test the getter of DriveInfo.VolumeLabel one would need to know the
volume labels of the drives of the test machine
- to test the setter of DriveInfo.VolumeLabel one would have to alter the
volume label of at least one of the drives of the test machine.

Any suggestions or ideas?

Thanks,
Horst



--
View this message in context: http://mono.1490590.n4.nabble.com/Fixing-bug-39915-DriveInfo-VolumeLabel-does-not-return-Volume-Label-under-Windows-tp4670441.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list


_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fixing bug 39915 (DriveInfo.VolumeLabel does not return Volume Label under Windows)

HKakuschke
Great idea, thank you.
The result of 'dir' or 'vol' command is somewhat language specific, but
should be parseable.

Unfortunately, I assume *setting* volume labels on the test machine is
usually not acceptable.

Thanks,
Horst




--
View this message in context: http://mono.1490590.n4.nabble.com/Fixing-bug-39915-DriveInfo-VolumeLabel-does-not-return-Volume-Label-under-Windows-tp4670441p4670443.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.dot.net/mailman/listinfo/mono-devel-list
Loading...