'Deletes the file and optionally all associated files.
:param file_path: The file to delete
:param associated_files: True to delete all files which differ only by extension, False to leave them'

def _delete(self, file_path, associated_files=False):

    if (not file_path):
        return
    file_list = [file_path]
    if associated_files:
        file_list = (file_list + self.list_associated_files(file_path, base_name_only=True, subfolders=True))
    if (not file_list):
        self._log(((u'There    were    no    files    associated    with    ' + file_path) + u',    not    deleting    anything'), sickrage.srCore.srLogger.DEBUG)
        return
    for cur_file in file_list:
        if os.path.isfile(cur_file):
            self._log((u'Deleting    file    ' + cur_file), sickrage.srCore.srLogger.DEBUG)
            file_attribute = os.stat(cur_file)[0]
            if (not (file_attribute & stat.S_IWRITE)):
                self._log(((u'Read    only    mode    on    file    ' + cur_file) + u'    Will    try    to    make    it    writeable'), sickrage.srCore.srLogger.DEBUG)
                try:
                    os.chmod(cur_file, stat.S_IWRITE)
                except:
                    self._log((u'Cannot    change    permissions    of    ' + cur_file), sickrage.srCore.srLogger.WARNING)
            os.remove(cur_file)
            sickrage.srCore.notifiersDict[u'synoindex'].deleteFile(cur_file)
