跨平台配置、选项、设置、首选项、默认值

发布于 2024-10-08 18:17:53 字数 425 浏览 0 评论 0原文

我对人们关于如何最好地在跨平台应用程序中存储首选项和默认设置的看法感兴趣。

我主要在 *nix 和 Windows 上使用 Node.js 和 Perl,但我也对更大的前景感兴趣。

在 *nix 世界中,“点文件”(和目录)非常常见,系统范围或应用程序默认设置通常驻留在一个路径中,而用户特定的设置则驻留在主目录中。此类文件和目录以点“.”开头。并默认从目录列表中隐藏。

Windows 具有注册表,其中还包含默认值和每用户覆盖的路径。

某些跨平台应用程序以自己的方式执行此操作,Firefox 使用 JavaScript 首选项文件。

跨平台应用程序是否应该跨平台使用同一个系统,或者说 *nix 上的点文件和 Windows 上的注册表?您最喜欢的编程语言是否有用于以标准方式访问它们的库或模块?是否有新兴的最佳实践,或者每个人都推出自己的最佳实践?

I'm interested in peoples' views on how best to store preferences and default settings in cross-platform applications.

I primarily work in node.js and Perl on *nix and Windows but I'm also interested in the bigger picture.

In the *nix world "dotfiles" (and directories) are very common with system-wide or application default settings generally residing in one path and user-specific settings in the home directory. Such files and dirs begin with a dot "." and are hidden by default from directory listings.

Windows has the registry which also has paths for defaults and per-user overrides.

Certain cross-platform apps do it their own way, Firefox uses JavaScript preference files.

Should a cross-platform app use one system across platforms or say dotfiles on *nix and registry on Windows? Does your favourite programming language have a library or module for accessing them in a standard way? Is there an emerging best practice or does everybody roll their own?

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

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

发布评论

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

评论(2

混浊又暗下来 2024-10-15 18:17:53

那么存储在DB中呢?它对集群友好,并且对我们来说效果很好。在我的上一份工作中,我们曾经将它们存储在目录服务器中。

Java 以 Preferences API

我不是 .Net 用户,但我认为他们有用户配置文件。

Python具体讨论: What's theficial way of storageing settings python 程序?

Ruby on Rails:Rails:存储用户的最佳实践设置?

What about storing in DB? It is cluster-friendly and has been working great for us. In my last job we used to store them in a directory server.

Java has support in the form of Preferences API.

I am not a .Net guy but I think they have User Profiles.

Python specific discussion: What's the official way of storing settings for python programs?

Ruby on Rails: Rails: Best practice to store user settings?

猫瑾少女 2024-10-15 18:17:53

我找到了

docs.python.org/lib/module-ConfigParser.html 和

wxpython.org/docs/api/wx.ConfigBase-class.html

I found

docs.python.org/lib/module-ConfigParser.html and

wxpython.org/docs/api/wx.ConfigBase-class.html

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