Submitted by: Billy Joe Long, Member/Manager
Company: Problem Solving Applications, LLC
Titled: Directory Structure and File Name Conventions
Original release date: October 19, 2018
Directory Structure and File Name Conventions
When storing data we, as responsible digital citizens, need to ensure our directory structures and file names are human readable and well organized. This ensures the digital information stored within your company (or home) can be retrieved efficiently and accurately. We start this discussion by looking at a few directory structure conventions and a usage example.
As with most things in life, consistency is critical. Organize directories in a way that makes sense within the context of your home or company, and then stick to it. It should make sense to anyone who happens to be working within the directory structure. For example, I work from a home based office, so my computer contains not only personal data (pictures, documents, ect), but also business data. The root of my storage directory structure clearly describes that distinction by providing two directories: ‘Personal’ and ‘Business’. Within the ‘Personal’ directory I have organized my personal digital life, and within the ‘Business’ directory I have organized my business digital life.
Once the initial directories were in place, I began to make more distinctions about the type of data the directory contained by using descriptive names and nesting related directories, where appropriate, in a hierarchical fashion.
Here is a simple example; let’s say you have hundreds (or more) pictures collected over many years. To efficiently organize these pictures, we first, create a ‘Pictures’ directory (one probably already exists on your computer). Then organize the pictures further by creating a year directory within the ‘Pictures’ directory, eg. 2018, 2019, ect. Then within each year directory you could include month directories, eg. JAN, FEB, ect. This directory structure can be as simple or complex as necessary. Personally, I adhere to the ‘keep it simple and consistent’ policy. Next, let’s take a look at ‘File Naming Conventions’.
A file name should be distinguishable among other files. Groups of files should be easily sorted for efficient reviewing and searching. File names should also be unique. Over time files can be moved and without the existing folder structure, important descriptive information about the contents of the file could be lost. Carefully consider whether your filename would be meaningful outside of your directory structure.
Here are guidelines I use consistently for file names within my company as well as at home:
- If the date the file was created is important, include it in the filename. If you are going to use the date, be sure to pick a date format and stick to it consistently. I like to use the MMDDYY format (two digit month, two digit day, two digit year.)
- If the file is related to a project, consider using an abbreviation of the project name as part of the file name.
- If the file is part of a multi-organizational effort, consider using your organizations initials in the name. Be sure your initials are unique among the other involved organizations.
- If there will be multiple versions of the file, consider using a ‘zero padded’ numbering system as part of the name. You will need to make an educated guess as to how many versions there may be, and pad the version number appropriately. At a minimum, I pad file versions with two zeros, eg. 001, 002, ect.
Finally, here is a list of the “Do’s and Don’ts” of file naming.
- Don’t use spaces and punctuation, except for the hyphen and underscore.
- Do use underscore or “camelCase” between file name elements, eg. my_data_file.txt or myDataFile.txt . Neither approach is better – but whichever one you pick, stick to it!
- Don’t use spaces, tabs, semicolons or periods in your filename.
- Do try to keep the file name to a maximum of 25 characters in length if possible.
A well thought out directory structure coupled with an equally well thought out file naming convention makes searching and sorting information a very straightforward task. If you work at a company, be sure to check and see if they have employee guidelines to directory and file naming conventions … they really should! One day we will retire, will the guy or gal replacing us be able to find anything efficiently? It’s really up to us.