def windows_get_size(path):
 import win32file
 if isbytestring(path):
  path = path.decode(filesystem_encoding)
 h = win32file.CreateFileW(path, 0, ((win32file.FILE_SHARE_READ | win32file.FILE_SHARE_WRITE) | win32file.FILE_SHARE_DELETE), None, win32file.OPEN_EXISTING, 0, None)
 try:
  return win32file.GetFileSize(h)
 finally:
  win32file.CloseHandle(h)

def windows_get_size ( path ) : import win32file if isbytestring ( path ) : path = path . decode ( filesystem_encoding ) h = win32file . CreateFileW ( path , 0 , ( ( win32file . FILE_SHARE_READ | win32file . FILE_SHARE_WRITE ) | win32file . FILE_SHARE_DELETE ) , None , win32file . OPEN_EXISTING , 0 , None ) try : return win32file . GetFileSize ( h ) finally : win32file . CloseHandle ( h )
on windows file sizes are only accurately stored in the actual file .