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/
cis7 file_unmanaged_delete($path)
cle7 file_unmanaged_delete($path)
elmsmedia7 file_unmanaged_delete($path)
icor7 file_unmanaged_delete($path)
meedjum_blog7 file_unmanaged_delete($path)
mooc7 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.


$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



Related topics

16 calls to file_unmanaged_delete()
advagg_delete_files_if_stale in sites/all/modules/ulmus/advagg/
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/
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/
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/
Remove all files from the advagg CSS/JS directories.
imce_crop_image in sites/all/modules/ulmus/imce_crop/
Crops an image.
imce_resize_image in sites/all/modules/ulmus/imce/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.


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


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 message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.