User Name
Password
AppleNova Forums » Programmer's Nook »

Best Practices : File Naming Conventions


Register Members List Calendar Search FAQ Posting Guidelines
Best Practices : File Naming Conventions
Thread Tools
drewprops
Magnificent Basturd™
sagacious-d
 
Join Date: May 2004
Location: Atlanta
 
2006-08-30, 08:33

This isn't programming, but programmer types are likely to be the best people to have a conversation about file-naming conventions, which I'm interested in exploring briefly if anyone has time. I'm trying to decide the best way to manage multiple versions of files using date schemes that include the year, the month as a number plus an abbreviation of the month as a name (since most of us 'see' words faster), etc, etc.

As an example: project_profiles(08aug2006).indd

What is being taught these days? Is there some standard of which I've been heretofore* unaware?

* triple point score

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-08-30, 08:40

I think most would suggest using an automatic version control system like CVS or SVN.

Naming by hand, though, I personally would go with filename_YYYYMMDD or filename_YYYY-MM-DD, ie filename_2006-08-30. That way the files will be properly listed in date order when sorted by name.

I much prefer using month numbers instead of textual abbreviations for the aforementioned sorting purposes. I can 'see' them just fine.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-08-30, 08:43

I'm not sure I see the need to have a date in the file name when dates are already stored anyway — creation date, last modification date, last access date. So, all you really need in the file name is a revision ID.
  quote
Kickaha
Likes his boobies blue.
 
Join Date: May 2004
Location: Hell
 
2006-08-30, 10:13

Depends on how you access the files, how you want to format that rev number.

In the Finder, it intelligently identifies that File9.txt is 'less than' File100.txt, and sorts it appropriately.

Terminal doesn't. You get them all out of 'order', and you need to prepend zeroes to pad the space. But then you get into "well, how *many* zeroes?" Do you want a max of 10 revisions? 100? 1000?

YMDhms always sorts correctly, which is why a lot of people use it. It also lets you insert a copy along the way if you get an intermediate version later, or you missed one along the conversion.

My other brain is hung like a horse too.
#IRC isn't old school.
Old school is being able to say 'finger me' with a straight face.
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-08-30, 10:40

Unless, of course, you use multiple files a day, in which case the question becomes "but how many files a day max?".
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-08-30, 11:02

Quote:
Originally Posted by chucker View Post
Unless, of course, you use multiple files a day, in which case the question becomes "but how many files a day max?".
Are you editing and saving the file multiple times per second? If not, YYYY-MM-DD-hh-mm-ss should work fine.
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-08-30, 11:07

In which case you end up with an even more ugly file name

Quote:
Originally Posted by Kickaha View Post
In the Finder, it intelligently identifies that File9.txt is 'less than' File100.txt, and sorts it appropriately.

Terminal doesn't. You get them all out of 'order', and you need to prepend zeroes to pad the space.
'ls -1tr'?
  quote
spikeh
BANNED
 
Join Date: Jan 2006
Location: UK
Send a message via AIM to spikeh Send a message via MSN to spikeh  
2006-08-30, 13:23

If your files are for the web, you should use hyphens instead of an underscore. Serach for huge_online_casino and then huge-online-casino to see the difference first-hand.
  quote
Kickaha
Likes his boobies blue.
 
Join Date: May 2004
Location: Hell
 
2006-08-30, 13:29

Okay, so that fixes ls, but what about other tools? How about ImageMagick's ability to take a list of images and combine them into one? Now you're out of order, unless you pipe it through ls first. Okay, but now what about scripts? Are you going to edit all of those?

It's much easier just to use a std format of either padded counters, or YMDhms. Either one works, it becomes an issue of which one you prefer. I prefer the latter, hands down, due to the flexibility.

My other brain is hung like a horse too.
#IRC isn't old school.
Old school is being able to say 'finger me' with a straight face.
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-08-30, 13:32

Quote:
Originally Posted by Kickaha View Post
It's much easier just to use a std format of either padded counters, or YMDhms. Either one works, it becomes an issue of which one you prefer. I prefer the latter, hands down, due to the flexibility.
T,tffy.
  quote
drewprops
Magnificent Basturd™
sagacious-d
 
Join Date: May 2004
Location: Atlanta
 
2006-08-30, 16:06

I usually end up making multiple versions of Illustrator & Photoshop files (made in the same work period) but those files are generally assigned to project directories which are already organized using date-specific titling.

for example: applenova_orgchart_002.ai

When I work on documents that are updated irregularly is when I want to drop back into a date-specific titling mode. The CVS and SVN sound familiar, is that the way that my web traffic files are organized in SQL?

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying hosts file...please help. SledgeHammer Genius Bar 21 2008-05-07 23:28
Darwine Requirements doublem9876 Third-Party Products 2 2006-02-26 10:58
Photoshop color help Yochanan Genius Bar 9 2005-12-07 13:26
File permissions for Apache web server jeff560 Genius Bar 0 2005-11-14 19:25
New File Browser? Electric Monk Speculation and Rumors 3 2005-06-16 21:53


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 03:45.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2019, AppleNova