I get the following error:

The directory sites/animals.m2osw.com/files/bitcache/file does not exist.

when I install and immediately uninstall your module.

It would be a good idea, I think, to test whether the path exists, and if not, just don't try to delete it.

Thank you.
Alexis Wilke

Comments

miglius’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -uninstall +install

The module does not directly creates or deletes the directory you mentioned, but it rather calls a bitcache module functions to create and delete file repository.

From your description it looks like that the file repository was not created in the bitcache on the module install. Could you verify that this is the case by installing the module again, then going to 'admin/settings/bitcache/repositories' and checking if File Framework repository is in the list?

jrobens’s picture

There is a bug in bitcache - doesn't check to see if 'file' is null. PHP just happy to process.

I just walloped a whole system with this - installed file framework for a couple of hours, it didn't install properly (as per http://drupal.org/node/425884).

Uninstall, uninstalled the entire machine.

It is basically a bug in bitcache.

file.install - you call

bitcache_delete_repository('file');

The reference to 'file' must have been null and then follows through in bitcache to:

foreach (glob($dirname . '/*', GLOB_NOSORT) as $file) {

Youch. I am going to raise a bug in bitcache as well. Can't be too paranoid with this stuff.

See file.inc in bitcache

function destroy(array $options = array()) {
if (!isset($options['contents']) || $options['contents'] !== FALSE) {
return $this->rmdir_rf($this->path); // delete the contents of the repository directory
}

/**
* Recursive version of rmdir(); use with extreme caution.
*
* @param $dirname
* the top-level directory that will be recursively removed
* @param $callback
* optional predicate function for determining if a file should be removed
*/
protected function rmdir_rf($dirname, $callback = NULL) {
$empty = TRUE; // begin with an optimistic mindset

foreach (glob($dirname . '/*', GLOB_NOSORT) as $file) {
if (is_dir($file)) {
if (!$this->rmdir_rf($file, $callback)) {
$empty = FALSE;
}
}
else if (is_file($file)) {
if (function_exists($callback) && !$callback($file)) {
$empty = FALSE;
continue;
}
@unlink($file);
}
else {
$empty = FALSE; // it's probably a symbolic link
}
}

// The reason for this elaborate safeguard is that Drupal will log even
// warnings that should have been suppressed with the @ operator.
// Otherwise, we'd just rely on the FALSE return value from rmdir().
return ($empty && @rmdir($dirname));
}
}

johanneshahn’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

we do not remove files or directories on uninstall anymore.

see: http://drupal.org/node/522878