如何决定文档文件扩展名?

发布于 2024-08-21 02:06:27 字数 426 浏览 6 评论 0原文

我正在编写一个新的基于文档的跨平台化学应用程序(Win、Mac、Unix),它以自己的格式保存文件(该领域不存在标准格式)。我正在尝试确定已保存文件的文件扩展名。我的问题是:

  • 如今坚持 3 个字符有多重要?
  • 在哪里可以查看该文件扩展名已被使用了多少? (当然,谷歌会提供帮助,但它不会告诉我某个应用程序的受欢迎程度)
  • 我真的需要使用特定于文件的扩展名吗?我的保存格式是 gzip'ed XML,因此我可以将其命名为 .xml.gz,但我担心它会让初学者感到困惑(即,当您看到它时,它不会立即“敲响警钟”) )。
  • 最后,您在选择自己的项目时还有其他重要的指导原则吗?

PS:我试图在“提供的信息太少”和“过于具体而对其他人没有真正有用”之间保持适当的平衡。如果需要的话,我很乐意在评论中提供更多信息。

I'm writing a new document-based cross-platform chemistry application (Win, Mac, Unix), which saves files in its own format (no standard format exists for this field). I'm trying to decide on a file extension for the saved files. My questions are:

  • How important is it nowadays to stick to 3 characters?
  • Where can you check how much this file extension is already used? (Google helps, of course, but it does not tell me how much a given app is popular)
  • Do I really need to use a file-specific extension? My save format is gzip'ed XML, so I could name it .xml.gz, but I fear it would confuse beginning users (i.e. when you see it, it does not immediately "ring a bell").
  • Finally, do you have other important guidelines when choosing for your own programs?

PS: I tried to keep the right balance between "giving too little information" and "being too specific to be really useful to others". I'll happily provide more information in comments if the need arises.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

溇涏 2024-08-28 02:06:27

FileInfo.com 列出了许多文件扩展名以及他们自己对使用量的估计。

我建议使用一个独特的扩展名(而不是 xml.gz),以便操作系统在查看文件列表或其他内容时可以向用户识别文件类型。 “敲响警钟”很重要,尤其是当您的用户不太熟练时。

我认为没有必要坚持 3 个字符,但我不会超过 5 个(除了个人喜好之外,我认为我没有真正的理由这样做)。

FileInfo.com lists a lot of file extensions along with their own estimation of how much it is ued.

I suggest a unique extension (rather then xml.gz) so that the OS can identify the file type to users when looking at a file listing or whatever. 'Ringing a bell' is important, especially if you will have less sophisticated users.

I don't see any need to stick to 3 characters, but I wouldn't go bigger than 5 (I don't suppose I have a real reason for this, other than personal preference).

栖迟 2024-08-28 02:06:27
  • 如今,坚持 3 个字符有多重要?

除非您必须支持较旧的操作系统,否则并非如此。当前的所有操作系统都可以毫无问题地处理大于 3 个字符的文件扩展名。想想 .html、.config、.resx,我确信还有更多。

  • 在哪里可以查看此文件扩展名的使用量?

查看 FileExt

  • 我真的需要使用特定于文件的扩展名吗?我的保存
    格式是 gzip'ed XML,所以我可以命名
    它.xml.gz,但我担心它会
    让初学者感到困惑(即当您
    看到它,它并没有立即“响”
    响铃”)。

请记住,Windows(和 Windows 用户)通过扩展名将文件与应用程序关联起来,因此使用过于通用的名称(例如 .xml.gz)可能会导致问题。您可能最好想出更适合您的文件类型的名称用户不关心您的格式是否在内部压缩 xml,他们关心文件中的内容,您的用户会将其视为包含化学信息而不是压缩 xml 的文件,因此 .chem 是。比 .xml.gz 更合适

一些关于事情的建议:

  1. 显然,不要与任何大的东西冲突 - 不要使用 .doc、.xls、.exe 等。

  2. 不要与您的用户群体可能安装的行业领域中常见的任何东西发生冲突,例如,如果您正在编写编程工具,请不要使用 .cs 或 .cpp 您可能最了解您的域,因此请编写您和您的用户可能安装的所有应用程序及其任何竞争对手的列表,并避免使用。

  3. 确保您的应用包含注册和取消注册扩展程序的选项。不要只是在安装时自动执行此操作,请确保它是一个选项。

  4. 请记住,unix/linux 和 Mac 区分大小写,因此请考虑默认情况下始终坚持全小写。

    请记住,unix/linux 和

  5. 记住 CD/DVD 文件命名规则更严格,因此不要使用非字母数字字符。

    记住 CD/DVD

  6. 最后,请记住,大多数非技术用户都会关闭文件扩展名,因此不要过分强调。

此处提供了更多信息。

维基百科有文件扩展名列表此处(按类型)这里(按字母顺序排列),还有一些一般信息

  • How important is it nowadays to stick to 3 characters?

It's not unless you have to support older operating systems. All current OSes handle >3 char file extensions without any problems. Think of .html, .config, .resx, and I'm sure there are more.

  • Where can you check how much this file extension is already used?

check out FileExt.

  • Do I really need to use a file-specific extension? My save
    format is gzip'ed XML, so I could name
    it .xml.gz, but I fear it would
    confuse beginning users (i.e. when you
    see it, it does not immediately "ring
    a bell").

Remember that windows (and windows users) associate files with applications by extension, so using something too generic like .xml.gz may cause problems. You are probably better coming up with something that is more specific to your file type or application. Users don't care weather your format is gzipped xml internally, they care about what is in the file. Think about abstraction layers, your users will think of it as a file containing chemistry info not gzipped xml, so .chem is far more appropriate than .xml.gz

Some suggestions of things to thing about:

  1. Obviously, don't clash with anything big - Don't use .doc, .xls, .exe, etc.

  2. Don't clash with anything common in your industry domain that your user demographic is likely to have installed. For example, if you are writing a programming tool, don't use .cs or .cpp. You probably know your domain best, so write a list of all the apps you and your users are likely to have installed, and any of their competitors and avoid them.

  3. Make sure your app includes the options to register and unregister the extension. don't just automatically do it in the installation, make sure it's an option.

  4. Remember unix/linux and Mac are case sensitive, so consider sticking to always all lower case by default.

  5. Remember CD/DVD file naming rules are stricter, so don't use non alpha numeric characters.

  6. Finally, remember that most non-tech users are going to have file extensions turned off, so don't stress about it too much.

There is more info here.

Wikipedia has lists of files extensions here (by type) and here (alphabetical), and also some general information

稍尽春風 2024-08-28 02:06:27
  1. 取决于平台,但一般来说,对于较新的操作系统来说不是很重要。检查您所针对的平台的文档。

  2. 我不知道还有比 Google 更好的替代方案。希望其他人对此有更好的建议。

  3. 除非您有某种理由这样做,否则不会。示例是“我想确保 Windows 始终使用我的应用程序打开此程序”。无论如何,我不确定您的用户是否需要关心扩展。例如,Windows 上的默认配置是隐藏已知文件类型的扩展名。但是,如果您有令人信服的理由(例如,允许您的程序轻松识别它应该能够处理的文件),那么您可以使用该扩展,或者您可以想出其他东西。

  4. 我只写过一次程序,我认为我需要提出自己的扩展。我用的是我名字的首字母。后来我意识到我并不真正需要特殊的扩展名并恢复为“.xml”。然而,大多数扩展似乎都是有意义的。 (.doc 用于文档等)因此,如果您确实需要走这条路,那么有意义的东西是个好主意。

  1. Depends on the platform, but in general, not very important for newer Operating Systems. Check the documentation for the platforms you're targeting.

  2. I'm not aware of better alternatives to Google. Hopefully someone else has a better suggestion for this one.

  3. Not unless you have some reason to do so. Examples would be "I want to ensure that Windows always opens this program with my app". I'm not sure that your users need to be concerned with the extension anyway. The default configuration on Windows, for example, is to hide extensions for known file types. BUT if you have a compelling reason (such as allowing your program to easily identify files it should be able to handle, for example) then you could use the extension, or you could come up with something else.

  4. I have only ever once written a program where I thought I needed to come up with my own extension. I used my initials. Then later I realized I didn't really need a special extension and reverted to ".xml". However, most extensions seem to be something that seems to mean something. (.doc for documents, etc.) so something meaningful is a good idea if you do need to go this route.

不乱于心 2024-08-28 02:06:27

这当然取决于您想要支持的操作系统,但如今人们已经在全球范围内突破了 3 个字符的扩展限制:例如,.html 广泛用于网页。

当然,如果你使用更长的扩展名,人们将不再在视觉上将其识别为文件扩展名,我认为......

It sure depends on the OSes you want to support, but people have globally moved over the 3-characters extension limit these days: .html is well used for webpages, for example.

Of course, if you go to much longer extensions, people will stop visually recognizing it as a file extension, I think...

北座城市 2024-08-28 02:06:27
  1. 除非您需要与您知道仍具有三个字母限制的特定操作系统兼容,否则无需将其保留为三个字符。如果您最终支持这些平台,那么拥有它的三个字符版本可能会很有用。

  2. 维基百科文件格式列表非常好。一些 mime 映射列表将列出与这些映射关联的常见扩展名。 Ray 已经提到了 FileInfo.com

  3. 这是一个方便的事情;我可能会选择您自己的文件,但记录下这样一个事实:它们只是符合特定 DTD 的压缩 XML 文件,并且使用户可以轻松地使用 .xml.gz。确保您的软件不关心扩展,以便用户甚至可以根据需要选择自己的扩展,尽管我倾向于通过提供合理的默认值来避免鼓励他们这样做。这

  4. 我会优先考虑可打字性、清晰度、独特性和简洁性——按这个顺序。例如,.config.q2z 更容易输入,但它的唯一性较差。 (我并不是建议您的应用程序使用它;这只是一个示例。)同样,.q2z 也很痛苦。 :-) 例如,.chemstuff 很容易输入,但可能不会在其他地方广泛使用。 (再次强调,这不是建议,只是一个示例。)

  1. Barring your needing to be compatible with a specific OS that you know still has the three-letter limitation, no need to keep it to three characters. It may be useful to have a three-character version of it if you end up supporting those platforms.

  2. The Wikipedia list of file formats is pretty good. Some mime mapping lists will list common extensions associated with those mappings. Ray already mentioned FileInfo.com.

  3. It's a convenience thing; I'd probably go with your own but document the fact that they're just gzipped XML files conforming to a specific DTD and make it easy for users to use .xml.gz instead. Be sure that your software doesn't care about the extension, so that users could even choose their own if they wanted, although I'd tend to avoid encouraging them to by providing a reasonable default.

  4. I'd go for typeability, clarity, uniqueness, and brevity -- in that order. For instance, .config is a lot easier to type than .q2z but it falls down on uniqueness. (I'm not suggesting it for your app; it's an example.) Similarly, .q2z is just a pain. :-) So for instance, .chemstuff is easy to type and probably not in wide use elsewhere. (Again, not a suggestion, just an example.)

浅唱々樱花落 2024-08-28 02:06:27

将其命名为 document_name.app_name.xml.gz,其中 document_name 和 app_name 是变量,后者是应用程序标题的一些易于阅读和识别的短字符串。

现代系统非常灵活,完全没有必要将 3 字符扩展拖得更远。

我同意 .xml.gz 会让用户感到困惑,但请记住,现代系统正在转向不基于扩展名来识别文件,而是通过探测文件头甚至内容来识别文件。事实上,用户通常不会看到这些扩展。对于 gzip 压缩的 XML 文件,系统可能会决定首先在内存中解压文件流,然后发现它是一个文本 XML 文件,然后它可能会将其“xmlns”作为应用程序标识符。然而,此类系统尚未广泛使用。无论如何,不​​要犯仅通过扩展名打开文件的错误 - 聪明并提高标准 - 严格执行上述操作,以确定该文件是否可以被视为您的应用程序的文档。

Have it as document_name.app_name.xml.gz where document_name and app_name are variables, the latter some easily readable and recognisable short string of your application's title.

Modern systems are quite flexible, and there is absolutely no need to drag the 3-character extensions further along in time with us.

I agree that .xml.gz would confuse users, however keep in mind that modern systems are moving into recognizing files not based on extensions but by probing their headers and even contents instead. In fact, users do not often even see the extensions. For gzipped XML files, a system may decide to first unpack the file stream in memory, then find out it is a literal XML file, then it may take its 'xmlns' as the application identifier. However, such systems are not yet widespread use. In any case, don't make the mistake of only opening files by extension - be smart and raise the bar - do exactly the above to find out if the file can be considered a document for your application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文