Thanks Tim, Shame about the None returns; I keep on bumping up against these!
I'm currently going for the over-read exception - a bit like over-kill, we read beyond the size reported in the smallest block size chunks (512 bytes) until an exception is raised. It does mean we will get 101% read progress reports and a slight delay at the end of our progress bar, but much like progress reported by Microsoft Minutes, it's an inaccuracy we can live with. Thanks for help, Chris. ----- Original Message ----- From: "Tim Golden" <m...@timgolden.me.uk> Cc: "Python win32 User List" <python-win32@python.org> Sent: Monday, 22 March, 2010 10:09:49 GMT +00:00 GMT Britain, Ireland, Portugal Subject: Re: [python-win32] Finding the physical USBSTOR disk size On 19/03/2010 10:30, Chris Jesse wrote: > I am trying to use WMI in order to get information about drives so >The problem that we are having is that we can't seem to get an accurate >size for the disks. > I know that in the past we were able to do so, using the Win32_Diskpartition > Size property but have recently found that this is no longer the case as it > is > inaccurate. We believe this is because we may not have tested it with a FAT > formatted media before. I'm not going to be much help here, I'm afraid, except to suggest that the likely API for this is going to be one of the DeviceIOControl functions: http://msdn.microsoft.com/en-us/library/aa363216%28VS.85%29.aspx http://timgolden.me.uk/pywin32-docs/win32file__DeviceIoControl_meth.html In principle, the parents of the Win32_LogicalDisk clsas (CIM_LogicalDisk, CIM_StorageExtent) should offer access to the lower-level data which makes up the Size attributes. But it doesn't seem to be implemented that way; they simply return None. TJG _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32