How are non-folder files called? [closed]

Maybe it looks like a weird question, but what term should be attributed inside the code for files that are not folders to differentiate them from folders?

If I need write 2 functions isFolder() and isFile() 2nd one has a misleading name because folders are files too

5

It really depends upon the file system and the operating system.

In POSIX and Unix, a file can be a directory, a plain file, a block device, a character device, a FIFO, a socket, a symbolic link, … See POSIX stat & Linux stat(2), notice that file can have different types.

So if you want to speak of a file whose type is plain and which is a sequence of bytes, you say that is is a plain file or a regular file.

If you want any file which is not a directory you could speak of a “non-directory” file (or maybe non-directory inode); it could be a plain file, a socket, a fifo, a symlink, etc…

Notice that POSIX and Linux don’t know about folders (except on the desktop). They speak of directories.

Notice also that files are quite different on Windows, on MacOSX, on Linux, on POSIX….

Some experimental OSes don’t even have files. They are persisting data in some other way. Historically, the very first editions of MS-DOS (or of MVS) did not had any directories (or folders).

This depends heavily on the filesystem and the operating system. For example, on Unix, there are no folders at all:Unix Filesystem Objects Hierarchy

Windows has completely different terminology. Classic MacOS had a different terminology, which, in OSX, is now mixing with Unix terminology.

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *