file_delete

Versions
4.6 – 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 463

<?php
function file_delete($path) {
  if (is_file($path)) {
    return unlink($path);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.