Usable file names ----------------- I've thought about file naming schemes and choosing suitable names on and off over the years, most recently in December when I was setting up my gopherhole and phlog. I jotted down the beginnings of this post in mid-January, and the past few nights I've been spending a bit of time writing my current thoughts and opinions, to finally put this out in the world, in case anyone else might find this interesting or have any thoughts about it. If so, I'd be very happy to hear from you about your thoughts on this, whether it be in the context of file names of phlog/blog posts and gopherholes/websites, other use-cases, or regular files in general. yyyy-mm-dd or yyyymmdd ~~~~~~~~~~~~~~~~~~~~~~ A date makes for a nice and short file name, but it doesn't convey any information about what's in the file on its own. For example, a file name 2020-07-13.txt tells me nothing about what is inside, and I would need to open it to find out -- which I may not always want to do, for one reason or another. I feel like in the spirit of being able to tell what I'm getting into before opening a gopher link (I'm thinking of the item type prefix in URLs), I would also like to know what I can expect in a file beyond its general type. hyphenated-title ~~~~~~~~~~~~~~~~ Descriptive, hyphenated or single word file names are a favourite of mine. I especially like to use them in collections where dates don't matter as much, for example if the material in the files are in a sense 'timeless' and can be expected to be maintained, kept up-to-date, and/or remain relevant long after they are initially written and published. On my own gopherhole and website, my notes, talks, and generic pages (e.g. contact page) follow this naming scheme. For example: gopher://kelar.org/0/~bandali/talks/jami-empowers-users.txt https://kelar.org/~bandali/talks/jami-empowers-users.html gopher://kelar.org/0/~bandali/bandali-computing.txt https://kelar.org/~bandali/bandali-computing.html I prefer relatively short URLs for my gopherhole/website pages. So, for each new page, I spend some time to come up with a concise and descriptive page name/title, resulting in an equally short file name. The file names can sometimes be further shortened, by omitting articles like 'the', 'a', and 'an'. As one may expect, this is a rather popular naming scheme, and one that seems to be a naturally good fit for many use-cases. I've come across many gopherholes and websites that use it for the file names of various kinds of pages and/or entries. My phlog post file names also initially used this scheme, but within about a week of writing the first post I moved on to the naming scheme described below. [ Update: I'm back at using this for my phlog posts again. -- 2023-07-08 ] [ Update: I'm now using this for my articles, and yyyy-mm-dd-hyphenized-title for my phlog posts again. -- 2023-08-12 ] [ Update: I'm back at using this for my phlog posts yet again. -bandali, 22feb24. ] yyyy-mm-dd-hyphenized-title or yyyymmdd-hyphenized-title ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a hybrid of the first and second naming schemes described above. It is the one I use for this phlog, and more generally the one I would use for other use-cases where the dates are important, where the collection could be considered an excursion, a journey, or a progression over time which inherently lends itself well to being sorted and browsed chronologically. [ Update: this is the naming scheme I used for my phlog posts for over a year, but ultimately decided on using simply the hyphenated-title (described above) for my phlog as well. My rationale is that (1) I really like short URLs, and (2) I wasn't using the main attraction of this approach to me, which automated generation of a list of posts as described below. Instead, my 'index' files serve as the source of truth for order of posts, and I'm okay with that. -- 2023-07-08 ] [ Update: I'm now using this naming scheme for my phlog posts again. -- 2023-08-12 ] [ Update: I'm using hyphenated-title again for my phlog too. -bandali, 22feb24. ] Before switching to yyyy-mm-dd-hyphenized-title file names for these phlog posts, I briefly used yyyymmdd-hyphenized-title. I like that the non-hyphenated yyyymmdd dates are two characters shorter, and that not using a hyphen to separate the components of the date resulted in the date looking as a single unit and be visually more distinct from the (hyphenated) words that follow it, but ultimately decided to go with hyphenated yyyy-mm-dd dates, because they are easier to read due to the separation of their parts, and that they are a more widely used and recognizable date format in general. Besides being easy to sort chronologically and being descriptive, another benefit of this naming scheme is that it yields relatively unique file names. This is especially useful in the context of gopherspace, where one can easily save a copy of a phlog post for reading later by simply downloading an entirely self-contained plain text file -- in contrast to HTML pages, which may have external dependencies such as external CSS. Having a descriptive, dated file name helps the potential reader/visitor get an idea of what it is generally about and when it was published before even opening it, and the relative uniqueness means a lower probability of collision with other files, should the reader choose to simply download/save a copy. Another useful aspect of this is automation. For instance, to generate a list of my phlog posts in reverse chronological order, I can fire up a terminal, cd (change directory) into the phlog directory, and run ls -1r | grep -v 'gophermap' The '-1' switch to ls tells it to list one file per line, and '-r' tells it to use reverse order while sorting. Finally, I exclude the gophermap file (analogous to an index.html file for websites) using an inverse grep ('-v' tells grep to select any line that does not match the given argument, gophermap). This can be easily extended and further formatted to fit whatever use-case at hand. For example, adding the following line to a gophermap file for a phlog in a gopherhole hosted by the Gophernicus gopher server would insert a list of the phlog post files in that directory into the gopher menu for that directory (the '=' in the beginning tells Gophernicus to run the remainder of the line in a shell and substitute the output into the gopher menu in its place): =ls -1r | grep -v 'gophermap' | xargs -d'\n' printf '0%s\t\n' Others ~~~~~~ Two unusual naming schemes I've seen around the gopherspace are randomly generated names like tmp.gCHDzGlDqn as created by mktemp from GNU coreutils, and Unix time like 1648258589 signifying the number of seconds since 1970-01-01 00:00:00 UTC (the Unix epoch). I personally don't see myself using either of these for my own posts or pages, but they're certainly interesting to see, and no doubt the folks choosing to use them have their valid reasons. For instance, perhaps, removing the burden of deciding on a more descriptive file name altogether if a random one would suffice. If you know of any other interesting and/or unusual file naming schemes, or you'd like to share your thoughts about any of the ones mentioned in this post, I'd be happy to hear from you; you can find my email addresses at the end of the post. Closing thoughts ~~~~~~~~~~~~~~~~ In this post I outlined my thoughts and current opinions about file names, particularly in the context of phlogs/blogs and gopherholes/websites, and gave reasons as to why I think each one may be more or less suitable for a particular use-case. It is not my intention in any way to invalidate anyone or their use-cases and choices when it comes to this, and as always my inbox is open to thoughts, comments, feedback, and email from you dear reader. :) Take care, and so long for now. bandali @kelar.org and @gnu.org