function drupal_unlink


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 drupal_unlink($uri, $context = NULL)
cle7 drupal_unlink($uri, $context = NULL)
elmsmedia7 drupal_unlink($uri, $context = NULL)
icor7 drupal_unlink($uri, $context = NULL)
meedjum_blog7 drupal_unlink($uri, $context = NULL)
mooc7 drupal_unlink($uri, $context = NULL)

Deletes a file.

PHP's unlink() is broken on Windows, as it can fail to remove a file when it has a read-only flag set.


$uri: A URI or pathname.

$context: Refer to

Return value

Boolean TRUE on success, or FALSE on failure.

See also


Related topics

14 calls to drupal_unlink()
advagg_install_update_htaccess in sites/all/modules/ulmus/advagg/advagg.install
Callback to delete files if size == 0 & modified more than 60 seconds ago.
Archive_Tar::_cleanFile in modules/system/
Archive_Tar::_close in modules/system/
Archive_Tar::_extractList in modules/system/
Archive_Tar::_openAppend in modules/system/

... See full list


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


function drupal_unlink($uri, $context = NULL) {
  $scheme = file_uri_scheme($uri);
  if ((!$scheme || !file_stream_wrapper_valid_scheme($scheme)) && (substr(PHP_OS, 0, 3) == 'WIN')) {
    chmod($uri, 0600);
  if ($context) {
    return unlink($uri, $context);
  else {
    return unlink($uri);



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.