Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

Which is correct: "Filename", "File Name" or "FileName"?

share|improve this question
    
Or "File-name"? –  Gnubie Apr 2 '13 at 19:07
add comment

7 Answers

up vote 29 down vote accepted

The original form of the word was "file name", as in the name of a file. These days (and probably for a good few years), the compound "filename" is widely accepted and perhaps most commonly used. Either is of course perfectly acceptable.

Do not, however, capitalise letters in the middle of a word, under any circumstances. (Unless you are writing variable names in code.)

share|improve this answer
4  
Similarly, don't use "File Name". There is no reason "Name" should ever be capitalized in the middle of a sentence. (Unless, I suppose, someone is named "Name", but that takes pedantry to new extremes.) –  res Nov 22 '10 at 14:37
    
@res: Yeah, that's a given. :) You don't want to capitalise either of the words unless "File" begins a sentence. –  Noldorin Nov 22 '10 at 14:45
    
I have never known "filename" to be a widely used closed-form compound term; there are, indeed, many instances of it around (particularly in code), but that doesn't necessarily make it correct. A generic term could be used which makes the use of either word redundant, and that is "path" - this applies to both files and directories, since both are simply file system objects. –  Grant Thomas Aug 1 '11 at 14:58
    
It might also be worth mentioning that Microsoft themselves don't consider "filename" appropriate in their Design Guidelines for Developers - so, they're not an authority on English language, but they do set standards in a vast amount of computing arenas (particularly worth heeding if this is programming related.) –  Grant Thomas Aug 1 '11 at 15:05
    
I agree with Microsoft here, yeah. Funnily enough I've noticed they don't always follow this rule in their APIs, but mostly, they do. –  Noldorin Aug 2 '11 at 8:13
show 2 more comments

Filename is in my experience the most common and in my opinion the best looking. File name is also acceptable, but I would only use it rarely, perhaps in a parallel construction such as the file name and size. I find word-medial capital letters distracting and unpleasant anywhere but program source code, so I would never even think of FileName. Edit: if that's the reason you're asking, in program source I would still use Filename for a class or filename for a variable, not FileName nor fileName, respectively.

The British National Corpus has 240 cites for filename and 72 cites for file name. It's not possible to search case-sensitively, but several reloads of the random sample of specific entries gave me no matches for FileName.

share|improve this answer
    
In the parallel construction example, wouldn't you more correctly say the file's name and size? –  LucasTizma Nov 22 '13 at 5:35
1  
@LucasTizma: Appositive and possessive both work. –  Jon Purdy Nov 22 '13 at 19:32
add comment

None of them. "filename" is not a proper noun, and thus should not be capitalized. If you begin a sentence with the word, then it should be "Filename".

share|improve this answer
add comment

The AHD has an entry for “filename”, so it is, at least, an established American English word. Thus it is “correct” for some situations.

Update: the word “pathname” is also included in the American Heritage Dictionary: Fifth Edition. So over time I will be changing my program variables from SettingFilePathName to SettingFilePathname.

share|improve this answer
add comment

Generally, I would say "filename", as that is what I have seen used in most software development textbooks. That's not to say that this is the standard by which all words should be measured, but given that the word is generally used in relation to computers I would imagine that it is safe to use.

share|improve this answer
add comment

Any two words (such as 'file name') used together for long enough periods of time end up with a single meaning in our collective language. When that happens, you can combine the two, though it's not advisable for formal usage. Words such as, for example, 'himself' are older, and common examples from the computer age include 'username', 'email', and 'desktop'.

For formal usage, consider spacing the words or using a hyphen, where appropriate.

share|improve this answer
    
I somehow do not like “file-name” even in formal context. Both “filename” and “file name” are fine. –  Tsuyoshi Ito Nov 23 '10 at 14:47
    
To clarify: some word combinations use spaces, while others use hyphens. By "where appropriate," I meant that you should use whichever you find appropriate. –  Michael Kozakewich Nov 23 '10 at 14:52
add comment

The OED has no entry for "filename." However, being a technical writer of 25 years, I have adopted this spelling because programmers and engineers prefer it. Still, it seems odd to me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.