开发者

Why do *nix programs use so many files? [closed]

开发者 https://www.devze.com 2023-02-14 06:14 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

Is there a programmatic advantage to having thousands of files on a volume?

For example, the archive I downloaded for Emacs 22.3 has more than 2,700 files in it. Are those all really necessary? Notepad++, which is comparable in functionality, has a mere 15-30 files in its core, depending on what plugins you use, and it works perfectly well with those.

Of course, the Emacs isn't the only example -- MinGW for C/C++ with MSYS is 8,800 files, while Visual Studio 2008 -- including the IDE and the C/C++ compilers -- is 12,000 files.

Do I really need that many files in order to be able to use Emacs, or do they provide an advantage to the developers of the orig开发者_运维百科inal program, or both?


The examples you give ended up this way by design.

  • Emacs: Emacs is a lisp script interpreter. Its GUI primitives are clearly intended to support text editing applications, but the underlying language and the core libraries are general purpose. The decision to go with scripts instead of plugins makes it very easy to hack, customize and expand the capabilities of Emacs. Countless developers and engineers have used Emacs to add syntax highlighting for proprietary languages, code completion, as well as input forms. In this light, you can think of Emacs as a forerunner for macro and scripting features of modern office productivity packages.
  • IDE and C/C++ compilers: C/C++ applications are compiled and linked by combining source code with static and dynamic libraries. A modern C/C++ compiler comes with a wide array of libraries, of which most typical applications would only use a fraction. Separating and organizing this content in separate files helps manage the large volume of contents for both the vendor and the users.


Files are a simple, natural, logical unit that can be easily handled in code. File systems are designed to effortlessly handle thousands of them. Saying that Emacs has too many files in it suggests a problem that might not actually exist.

0

精彩评论

暂无评论...
验证码 换一张
取 消