function file_delete

7.x file.inc file_delete(stdClass $file, $force = FALSE)
6.x file.inc file_delete($path)

Delete a file.

Parameters

$path A string containing a file path.:

Return value

TRUE for success, FALSE for failure.

Related topics

9 calls to file_delete()
file_move in drupal-6.x/includes/file.inc
Moves a file to a new location.
locale_uninstall in drupal-6.x/modules/locale/locale.install
Implementation of hook_uninstall().
system_cron in drupal-6.x/modules/system/system.module
Implementation of hook_cron().
upload_delete in drupal-6.x/modules/upload/upload.module
upload_delete_revision in drupal-6.x/modules/upload/upload.module

... See full list

2 string references to 'file_delete'
drupal_clear_css_cache in drupal-6.x/includes/common.inc
Delete all cached CSS files.
drupal_clear_js_cache in drupal-6.x/includes/common.inc
Delete all cached JS files.

File

drupal-6.x/includes/file.inc, line 544
API for handling file uploads and server file management.

Code

function file_delete($path) {
  if (is_file($path)) {
    return unlink($path);
  }
}