diff --git includes/file.inc includes/file.inc
index 26a6c41..e3cdeda 100644
--- includes/file.inc
+++ includes/file.inc
@@ -1259,7 +1259,12 @@ function file_delete(stdClass $file, $force = FALSE) {
  */
 function file_unmanaged_delete($path) {
   // Resolve streamwrapper URI to local path.
-  $path = drupal_realpath($path);
+  $localpath = drupal_realpath($path);
+  if ($localpath === FALSE) {
+    // watchdog('file', 'drupal_realpath("%path") returned FALSE', array('%path' => $localpath), WATCHDOG_NOTICE);
+    return TRUE;
+  }
+  $path = $localpath;
   if (is_dir($path)) {
     watchdog('file', '%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path), WATCHDOG_ERROR);
     return FALSE;
@@ -1302,7 +1307,12 @@ function file_unmanaged_delete($path) {
  */
 function file_unmanaged_delete_recursive($path) {
   // Resolve streamwrapper URI to local path.
-  $path = drupal_realpath($path);
+  $localpath = drupal_realpath($path);
+  if ($localpath === FALSE) {
+    // watchdog('file', 'drupal_realpath("%path") returned FALSE', array('%path' => $localpath), WATCHDOG_NOTICE);
+    return TRUE;
+  }
+  $path = $localpath;
   if (is_dir($path)) {
     $dir = dir($path);
     while (($entry = $dir->read()) !== FALSE) {
