Internal method to clear thumbnails
@param array $filenames Filenames
@return int|bool Number of thumbnails deleted otherwise `false` in case of error
13644
protected function _clear($filenames)
    {
        $count = 0;

        foreach ($filenames as $filename) {
            if (!(new File($this->getPath($filename)))->delete()) {
                return false;
            }

            $count++;
        }

        return $count;
    }
672665
public function delete_many(array $keys) {
        $count = 0;
        foreach ($keys as $key) {
            if ($this->delete($key)) {
                $count++;
            }
        }
        return $count;
    }
1187477
public function delete_many(array $keys) {
        // The number of items that have actually being removed.
        $reduction = 0;
        foreach ($keys as $key) {
            if (isset($this->store[$key])) {
                $reduction++;
            }
            unset($this->store[$key]);
        }
        if ($this->maxsize !== false) {
            $this->storecount -= $reduction;
        }
        return $reduction;
    }
265115
public static function cleanThumbnail(): array
    {
        $result = [];
        $files = Finder::findFiles('*')->in(self::$parameters['thumbPath']);
        foreach ($files as $file) {
            if (unlink($file->getPathname())) {
                $result[] = $file->getPathname();
            }
        }
        return $result;
    }
823695
public function removeFile( $fileName )
	{
		$this->connection->checkConnection();
		return @ftp_delete( $this->connection->getResource(), $fileName );
	}
1289846
public function deleteFiles(array $files)
    {
        $count = 0;
        foreach ($files as $file) {
            if ($this->zip->deleteName($file) === false)
                throw new Exception($this->zip->getStatusString(), $this->zip->status);
            $count++;
        }

        // reopen archive to save changes
        $archive_filename = $this->zip->filename;
        $this->zip->close();
        $this->open($archive_filename);

        return $count;
    }
1108886
public function rm($filename)
    {
        $result = $this->client
            ->deleteObject(array(
                'Bucket' => $this->name,
                'Key'    => $filename
            ));

        return $result;
    }
973923
public function clearFile()
    {
        $cleared = false;

        if (isset($this->file_pointer)) {
            $cleared = $this->file_pointer->ftruncate(0);
        }

        return $cleared;
    }
676025
protected function getFilesToDelete()
    {
        $dirName    = dirname($this->baseFilename);
        $baseName   = basename($this->baseFilename);
        $fileNames  = scandir($dirName);
        $result     = array();
        $prefix     = $baseName . '.';
        $plen       = strlen($prefix);

        foreach ($fileNames as $fileName) {
            if ($fileName == '.' || $fileName == '..') {
                continue;
            }

            if (!strncmp($fileName, $prefix, $plen)) {
                $suffix = substr($fileName, $plen);
                if (preg_match($this->extMatch, $suffix)) {
                    $result[] = $dirName . DIRECTORY_SEPARATOR . $fileName;
                }
            }
        }

        sort($result);
        $rlen = count($result);
        if ($rlen < $this->backupCount) {
            $result = array();
        } else {
            $result = array_slice($result, 0, $rlen - $this->backupCount);
        }
        return $result;
    }
364250
def clear(self, delete_thumbnails=False):
        
        prefix = settings.THUMBNAIL_KEY_PREFIX
        for key in self._find_keys_raw(prefix):
            self.cache.delete(key)
        KVStoreModel.objects.filter(key__startswith=prefix).delete()
        if delete_thumbnails:
            self.delete_all_thumbnail_files()
1064779
private function removeFiles($files)
    {
        // Grab the duration
        $duration = $this->option('duration');
        
        // Grab the minimum acceptable timestamp
        $timestamp = time() - $duration;

        // Cycle through the list checking their creation dates
        foreach($files as $file)
        {
            // Compare the file modification times
            if(filemtime($file) < $timestamp)
            {
                // It passes the acceptable, so remove it
                unlink($file);

                // Check if the directory containing this file is empty
                if(count(scandir(dirname($file))) == 2)
                {
                    // It was empty, so just remove it
                    rmdir(dirname($file));
                }
            }
        }
    }
539731
public function remove(array $RemoveFiles = [])
    {
        /// Convert all paths in base64
        $removedFiles_b64 = $this->encodePaths($RemoveFiles);

        $result = $this->callService('POST', self::API_FS_RM, [
            'files' => $removedFiles_b64,
        ]);

        return $result->getModel(models\FileSystem\FsTask::class);
    }
158609
public function delete($filename)
		{
			if (true === $this->_enabled && !empty($filename)) {
				$index	= $this->_zip->locateName($filename, \ZipArchive::FL_NODIR);

				if ($index) {
					return $this->deleteIndex((int)$index);
				}
			}

			return false;
		}
559308
protected function cleanup($fileName)
	{
		$status = true;
		$fileNameUncompressed = $this->getUncompressedFileName($fileName);
		if ($fileName !== $fileNameUncompressed)
			$status = File::delete($fileName);

		return $status;
	}
133827
public function deleteFiles($paths)
    {
        $fullPaths = [];
        foreach ($paths as $path) {
            $path = self::validatePath($path);
            $fullPaths[] = $this->getMediaPath($path);
        }

        return $this->getStorageDisk()->delete($fullPaths);
    }
351706
public boolean remove(String fileName) {
      writeLock.lock();
      try {
         return filenames.remove(fileName);
      } finally {
         writeLock.unlock();
      }
   }
97135
public function delete(array $keys) {
		foreach ($keys as $key) {
			if (!isset($this->_cache[$key])) {
				return false;
			}
			unset($this->_cache[$key]);
		}
		return true;
	}