Answer the question
In order to leave comments, you need to log in
What came first: file or directory :)?
I understand that the question is somewhat stupid, and the answer has no practical application, but still in your opinion?
Answer the question
In order to leave comments, you need to log in
Evolution: bit > byte > file > directory > partition/volume > media
The file system (FS) organization structure was the first.
The concepts of "file" and "directory" - appeared at the same time! (after the end of the FS design)
file - a record of some data on the media.
the first files occupied the entire volume of the media.
then there were systems for recording several files in the form of a structured file system. the first fs did not contain directories in principle, there were several named areas on the media.
And only then, with an increase in the volume of the media and an increase in the number of files, a system for organizing files in the form of directories appeared.
W: File system, Directory hierarchy
From the point of view of any operating system, a directory is just a file with a specific content format.
To make it clearer - .txt files can be processed by text editors, xls files - can be processed by MS EXCEL, jpg -Photoshop. Those. these programs "know" the internal format of files that have the specified extension and therefore can work with them (at the same time, they do not know the format of files with other extensions and cannot work with them).
In the same way, the operating system, like any other program, also "knows" how to work with files of certain extensions. (For example, she "knows" that the exe-file should just be loaded into RAM and executed). At the same time, it (or rather, its component that performs the functions of managing access to information on external media) "knows" that the directory file simply contains information inside - a description of other files on the same media, for example, the name of such files, their physical location, date of creation, date of modification, possibly size, etc. Moreover, other directories can act as such files, linking them into a hierarchy of directories on the disk in this way.
So the answer is unequivocal - the concept of a file is primary, the concept of a directory is secondary.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question