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()

file_move in includes/file.inc
Moves a file to a new location.
locale_uninstall in modules/locale/locale.install
Implementation of hook_uninstall().
system_cron in modules/system/system.module
Implementation of hook_cron().
upload_delete in modules/upload/upload.module
upload_delete_revision in modules/upload/upload.module
upload_save in modules/upload/upload.module
user_validate_picture in modules/user/user.module
_locale_rebuild_js in includes/locale.inc
(Re-)Creates the JavaScript translation file for a language.
_user_edit_submit in modules/user/user.module

Code

includes/file.inc, line 432

<?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.