Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to come up with a name for a class that can represent both files and folders. Anyone know a word for this?

share|improve this question

closed as primarily opinion-based by gnat, Snowman, enderland, MichaelT, Ixrec Sep 1 '15 at 0:13

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

I think this has been asked before but I can't seem to find it... I'd suggest "Filesystem Object". – FrustratedWithFormsDesigner Jan 16 '13 at 16:58
FileSystem node? – Oded Jan 16 '13 at 17:16
If you are developing in the Windows environment, I would not recommend "Filesystem Object", since this has already a different meaning (it means a special COM object provided by Microsoft as part of the Scripting Runtime library, see – Doc Brown Jan 16 '13 at 18:56
Folder entry? – rwong Sep 17 '13 at 9:07
up vote 6 down vote accepted

Consider FileNode or FileSystemNode.

I've used FileNode in previous projects, the other devs were able to guess what it did from the name. The -Node part lets others know you're working with a tree.

share|improve this answer
I prefer FileSystemNode, as FileNode sounds like it might be specific to files. – Brian Sep 17 '13 at 12:52

It depends on the operating system and the file system. On Unix, a directory is just a special file, so the correct term would be file.

NTFS has a similar unifying concept, albeit much more complex than on Unix, called attribute.

share|improve this answer
Although technically correct, I feel that most people would assume a class "file" is associated with documents, not folders. – Cavyn VonDeylen Jan 16 '13 at 17:27
Documents are yet another can of worms entirely. A single document may be split across multiple files and a single file may contain multiple documents. – Jörg W Mittag Jan 16 '13 at 17:39
I don't know what to call anything anymore. – Cavyn VonDeylen Jan 16 '13 at 17:45

As everything (except the root folder or root of a drive) is ultimately contained within a folder, you could just go for FolderElement, although FilesystemObject (as suggested by @FrustratedWithFormsDesigner in a comment) also sounds good.

share|improve this answer

Why don't you just call you class "FilesAndFolders" or do you have a character-limit for naming? Well I guess you could call all of them entities, so: "FileSystemEntity"

share|improve this answer

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