Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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
4  
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
3  
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 msdn.microsoft.com/en-us/library/aa242706%28v=vs.60%29.aspx) –  Doc Brown Jan 16 '13 at 18:56
1  
Folder entry? ntfs.com/fat-folder-structure.htm –  rwong Sep 17 '13 at 9:07

4 Answers 4

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
1  
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
2  
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
6  
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

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.