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/api.elmsln.org/includes/bootstrap.inc).
cis7 file.inc drupal_unlink($uri, $context = NULL)
cle7 file.inc drupal_unlink($uri, $context = NULL)
elmsmedia7 file.inc drupal_unlink($uri, $context = NULL)
icor7 file.inc drupal_unlink($uri, $context = NULL)
meedjum_blog7 file.inc drupal_unlink($uri, $context = NULL)
mooc7 file.inc 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.

Parameters

$uri: A URI or pathname.

$context: Refer to http://php.net/manual/ref.stream.php

Return value

Boolean TRUE on success, or FALSE on failure.

See also

unlink()

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/system.tar.inc
Archive_Tar::_close in modules/system/system.tar.inc
Archive_Tar::_extractList in modules/system/system.tar.inc
Archive_Tar::_openAppend in modules/system/system.tar.inc

... See full list

File

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

Code

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 | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.