You are here

function file_delete in Drupal 4

Same name and namespace in other branches
  1. 8 core/includes/file.inc \file_delete()
  2. 5 includes/file.inc \file_delete()
  3. 6 includes/file.inc \file_delete()
  4. 7 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

7 calls to file_delete()
file_move in includes/file.inc
Moves a file to a new location.
upload_delete in modules/upload.module
upload_delete_revision in modules/upload.module
upload_save in modules/upload.module
_upload_prepare in modules/upload.module
Save new uploads and attach them to the node object. append file_previews to the node object as well.

... See full list

File

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

Code

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