diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php
index <HASH>..<HASH> 100644
--- a/cache/stores/file/lib.php
+++ b/cache/stores/file/lib.php
@@ -308,9 +308,13 @@ class cachestore_file implements cache_store, cache_is_key_aware {
     public function delete($key) {
         $filename = $key.'.cache';
         $file = $this->path.'/'.$filename;
-        $result = @unlink($file);
-        unset($this->keys[$filename]);
-        return $result;
+
+        if (@unlink($file)) {
+            unset($this->keys[$filename]);
+            return true;
+        }
+
+        return false;
     }
 
     /**
MDL-<I> Improved the deletion logic to preserve the 'prescan' setting