def windows_get_fileid(path):
 import win32file
 from pywintypes import error
 if isbytestring(path):
  path = path.decode(filesystem_encoding)
 try:
  h = win32file.CreateFileW(path, 0, 0, None, win32file.OPEN_EXISTING, win32file.FILE_FLAG_BACKUP_SEMANTICS, 0)
  try:
   data = win32file.GetFileInformationByHandle(h)
  finally:
   win32file.CloseHandle(h)
 except (error, EnvironmentError):
  return None
 return (data[4], data[8], data[9])

def windows_get_fileid ( path ) : import win32file from pywintypes import error if isbytestring ( path ) : path = path . decode ( filesystem_encoding ) try : h = win32file . CreateFileW ( path , 0 , 0 , None , win32file . OPEN_EXISTING , win32file . FILE_FLAG_BACKUP_SEMANTICS , 0 ) try : data = win32file . GetFileInformationByHandle ( h ) finally : win32file . CloseHandle ( h ) except ( error , EnvironmentError ) : return None return ( data [ 4 ] , data [ 8 ] , data [ 9 ] )
the fileid uniquely identifies actual file contents .