14

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?

  • 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 http://msdn.microsoft.com/en-us/library/aa242706%28v=vs.60%29.aspx) – Doc Brown Jan 16 '13 at 18:56
  • 1
    Folder entry? http://www.ntfs.com/fat-folder-structure.htm – rwong Sep 17 '13 at 09:07
  • If you google "folder" and "file" you get back the same image results (so they share similar meaning), which makes me think that you can just call both files and folders "file" just like linux does it. – Timo Huovinen Nov 11 '20 at 10:24

4 Answers4

8

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.

4

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.

3

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.

Jörg W Mittag
  • 103,514
0

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"

Pieter B
  • 13,220