Same name and namespace in other branches
  1. 4.6.x includes/file.inc \file_delete()
  2. 4.7.x includes/file.inc \file_delete()
  3. 6.x includes/file.inc \file_delete()
  4. 7.x includes/file.inc \file_delete()
  5. 8.9.x core/includes/file.inc \file_delete()

Delete a file.

Parameters

$path A string containing a file path.:

Return value

True for success, FALSE for failure.

Related topics

8 calls to file_delete()
fileupload_delete in developer/examples/fileupload.module
Implementation of hook_delete().
fileupload_update in developer/examples/fileupload.module
Implementation of hook_update().
upload_delete in modules/upload/upload.module
upload_delete_revision in modules/upload/upload.module
upload_save in modules/upload/upload.module

... See full list

1 string reference to 'file_delete'
drupal_clear_css_cache in includes/common.inc
Delete all cached CSS files.

File

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

Code

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