問題描述
表示“目錄”或“文件”的詞是什麼? (What is the word that means "directory" or "file"?)
I'm trying to name an object that can be a file or a directory. What's the correct terminology for this?
I've considered
handle -> rejected, object is not a handle
address -> rejected, object is not an address
object -> rejected, too generic, should be better terminology
When I say "object" in my first sentence, I'm specifically talking about a <div>
in an HTML DOM, but it could be anything.
To put my question a different way, what's the parent word of the children "file" and "directory"? e.g. a foo
can be a file, or a directory.
參考解法
方法 1:
I've heard the phrase "file system object", although it's painful to say :)
方法 2:
In Unix we call any file and directory an inode
, since a file is not many different from a directory in binary representation.
方法 3:
So just for reference Java has a File class that can be a directory or a standard file. Basically treating a directory as a special case of a file. java.io.File class
Also, you could go old school and just name it AbstractFile.
方法 4:
In Unix, everything -- both a directory and a file -- is a file.
(by Ben、user541686、Oh Chin Boon、Kevin S、user649198)