#NEWLINE# def FileEntryExistsByPathSpec( self , path_spec ) : #NEWLINE# #INDENT# 'Determines if a file entry for a path specification exists.\n\n    Args:\n      path_spec: a path specification (instance of PathSpec).\n\n    Returns:\n      Boolean indicating if the file entry exists.\n    ' #NEWLINE# location = getattr ( path_spec , 'location' , None ) #NEWLINE# if ( location is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# is_device = False #NEWLINE# if ( platform . system ( ) == 'Windows' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# is_device = pysmdev . check_device ( location ) #NEWLINE# #UNINDENT# except IOError as exception : #NEWLINE# #INDENT# exception_string = str ( exception ) #NEWLINE# if ( not isinstance ( exception_string , py2to3 . UNICODE_TYPE ) ) : #NEWLINE# #INDENT# exception_string = py2to3 . UNICODE_TYPE ( exception_string , errors = 'replace' ) #NEWLINE# #UNINDENT# if ( ' access denied ' in exception_string ) : #NEWLINE# #INDENT# is_device = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( not is_device ) and ( not os . path . exists ( location ) ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True