function file_unmanaged_delete

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 file.inc file_unmanaged_delete($path)
cle7 file.inc file_unmanaged_delete($path)
elmsmedia7 file.inc file_unmanaged_delete($path)
icor7 file.inc file_unmanaged_delete($path)
meedjum_blog7 file.inc file_unmanaged_delete($path)
mooc7 file.inc file_unmanaged_delete($path)

Deletes a file without database changes or hook invocations.

This function should be used when the file to be deleted does not have an entry recorded in the files table.

Parameters

$path: A string containing a file path or (streamwrapper) URI.

Return value

TRUE for success or path does not exist, or FALSE in the event of an error.

See also

file_delete()

file_unmanaged_delete_recursive()

Related topics

16 calls to file_unmanaged_delete()
advagg_delete_files_if_stale in sites/all/modules/ulmus/advagg/advagg.cache.inc
Given an array of files remove that file if atime is grater than 30 days.
advagg_install_delete_empty_file_if_stale in sites/all/modules/ulmus/advagg/advagg.install
Callback to delete files if size == 0 & modified more than 60 seconds ago.
backup_migrate_destination_files::_delete_file in sites/all/modules/ulmus/backup_migrate/includes/destinations.file.inc
File delete destination callback.
css_injector_uninstall in sites/all/modules/ulmus/css_injector/css_injector.install
Implements hook_uninstall().
ctools_css_clear in sites/all/modules/ulmus/ctools/includes/css.inc
Remove stored CSS and any associated file.

... See full list

4 string references to 'file_unmanaged_delete'
advagg_remove_all_aggregated_files in sites/all/modules/ulmus/advagg/advagg.cache.inc
Remove all files from the advagg CSS/JS directories.
imce_crop_image in sites/all/modules/ulmus/imce_crop/imce_crop.inc
Crops an image.
imce_resize_image in sites/all/modules/ulmus/imce/inc/imce.page.inc
Resize an image in the file list. Also used for thumbnail creation.
piwik_clear_js_cache in sites/all/modules/ulmus/piwik/piwik.module
Delete cached files and directory.

File

includes/file.inc, line 1317
API for handling file uploads and server file management.

Code

function file_unmanaged_delete($path) {
  if (is_dir($path)) {
    watchdog('file', '%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path), WATCHDOG_ERROR);
    return FALSE;
  }
  if (is_file($path)) {
    return drupal_unlink($path);
  }
  // Return TRUE for non-existent file, but log that nothing was actually
  // deleted, as the current state is the intended result.
  if (!file_exists($path)) {
    watchdog('file', 'The file %path was not deleted, because it does not exist.', array('%path' => $path), WATCHDOG_NOTICE);
    return TRUE;
  }
  // We cannot handle anything other than files and directories. Log an error
  // for everything else (sockets, symbolic links, etc).
  watchdog('file', 'The file %path is not of a recognized type so it was not deleted.', array('%path' => $path), WATCHDOG_ERROR);
  return FALSE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.