file_delete

  1. drupal
    1. 4.7
    2. 5
    3. 6 file.inc
    4. 7 file.inc
Versions
4.7 – 6 file_delete($path)
7 file_delete(stdClass $file, $force = FALSE)

Delete a file.

Parameters

$path A string containing a file path.

Return value

True for success, FALSE for failure.

Related topics

▾ 9 functions call file_delete()

fileupload_delete in developer/examples/fileupload.module
Implementation of hook_delete().
fileupload_update in developer/examples/fileupload.module
Implementation of hook_update().
file_move in includes/file.inc
Moves a file to a new location.
upload_delete in modules/upload/upload.module
upload_delete_revision in modules/upload/upload.module
upload_save in modules/upload/upload.module
_upload_prepare in modules/upload/upload.module
Save new uploads and attach them to the node object. append file_previews to the node object as well.
_upload_validate in modules/upload/upload.module
_user_edit_submit in modules/user/user.module

Code

includes/file.inc, line 464

<?php
function file_delete($path) {
  if (is_file($path)) {
    return unlink($path);
  }
}
?>