Concrete File Structure

Permalink 1 user found helpful
Just wanting to start a discussion about the concrete file structure..

I have just completed an experiment on one of my sites root/files folder,
It is a large site with in excess of 100 users all with their own fileset for uploading and displaying images to their own pages and galleries..

This is what I did..
Downloaded the entire root/files/ folder to my PC (win7)
Using windows explorer's search facility, I searched for index.html the search found 26,997 instances of this file, I deleted all of them,
Using a file utility called Bitser, I searched for empty folders, on the first pass Bitser found 12,759 empty folders which were deleted,
on the second pass Bitser found 737 empty folders which were also deleted,
the third pass found 86 and the final pass found just 1 (all deleted)

A total of 26,977 index.html files were deleted and 13,583 empty folders deleted,
This left 7051 files and 13,243 folders remaining..

I then went to my wamp install and renamed the root/files/ folder to root/files-old/ and copied and pasted the cleaned up files folder to root/files/

I then thoroughly tested my wamp install to look for any errors or issues, non found, all appears to be working just fine,

Having satisfied myself that the experiment was successful I carried out the same procedure on my live server, replacing the root/files/ folder with my cleaned out version with no apparent problems.

Thoughts and comments are invited..

weyboat
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
The index.html (edit) files are there to prevent apache auto-indexing the directories should someone simply browse them. There are other ways to prevent that, so without index.php files in the directories still in use you will need to make sure auto indexing does not happen or it could leave a security hole.

At some point in the future someone will upload a file and the core will try and place it in a directory now deleted. The big question is whether that directory will get auto created and the upload succeed, or whether it will fail.

Should the above prove to be a non-problem, the overall algorithm you describe could be coded in php as a concrete5 job that will be of interest to those with hosting services that limit file or inode use.
weyboat replied on at Permalink Reply
weyboat
Hi John
The files I deleted were index.html and not index.php although I suspect that you meant index.html in your post,
As I understand it (and I could be wrong) concrete creates folders as and when they files are uploaded/needed,
I have since making the changes uploaded several files as a test with no errors (yet),
JohntheFish replied on at Permalink Reply
JohntheFish
Yes, I meant html, have edited the above post to correct it. The core certainly creates directories as needed for new files. Ideally it will simplistically do the same for new and old paths and hence not a problem.