Parent directory not created when using file adapter

Justin Miller - May 20, 2009 - 00:26
Project:Bitcache
Version:6.x-1.0-beta2
Component:Storage adapters
Category:bug report
Priority:normal
Assigned:Arto
Status:active
Issue tags:File Framework
Description

I've been able to replicate this a few times in fresh installs.

When Bitcache is enabled, followed by File Framework, which wants to use the file storage adapter, an error occurs:

The directory sites/default/files/bitcache/file does not exist.

The file directory can't be created unless the bitcache parent folder is created first.

Since the API calls used by File Framework's install routine don't return boolean values, installation of File Framework seems successful even though there is no place to store files.

This also can cause problems later when File Framework is uninstalled (not just disabled) as some inadvertent file deletions can occur since the Bitcache repository is attempted to be deleted but does not exist.

If this is intentional, so be it. But if it's not, I'll submit a patch to create the parent directory when creating a file repository.

#1

Arto - May 20, 2009 - 01:01
Title:parent directory not created when using file adapter» Parent directory not created when using file adapter
Assigned to:Anonymous» Arto

No, it's not intentional. Ideally it should work like "mkdir -p", creating all parent directories if needed. A patch to that effect would be most welcome.

#2

Arto - May 20, 2009 - 01:03

As a further note: I think we introduced this bug in beta1 or beta2, when we changed the default Bitcache repository to use the database storage adapter instead of the file system adapter.

 
 

Drupal is a registered trademark of Dries Buytaert.