Karl Rixon

CakePHP “empty” Files in Each Directory

with one comment

If you use CakePHP you have probably noticed that each empty directory contains a file named “empty” which is, unsurprisingly, empty. The purpose of this file is to allow the CakePHP project to be managed via Git, which tracks only files and not directories. In order to add a directory to a project, it must contain a file.

Usually this isn’t a problem, you can just ignore these files, but if you want to revision control your source code (which is always a good idea), you probably don’t want to include these empty files. Here is a quick and easy way to get rid of them before your initial import:

1
2
$ cd /path/to/your/working/directory
$ find . -type f -name 'empty' -print0 | xargs -0 rm -rdf

You should now be a few dozen empty files lighter.

Written by Karl

October 23rd, 2009 at 1:01 pm

Posted in CakePHP

One Response to 'CakePHP “empty” Files in Each Directory'

Subscribe to comments with RSS or TrackBack to 'CakePHP “empty” Files in Each Directory'.

  1. This saves the day and a lot of headache thanks

    Kaiak

    31 Aug 10 at 8:01 am

Leave a Reply