在 emacs 中为文件系统以外的其他东西实现一个 dired 接口?
高能物理中常用的ROOT数据分析框架使用二进制文件格式,其内部结构类似于真实的文件系统(即文件夹和文件)。 程序的 ls() 方法输出如下所示:
KEY: TH1D name1
KEY: TH1D name2
KEY: TH2D name3
....
其中“TH1D”和“TH2D”等只是对象类型。 在 emacs 中以类似 dired 的界面浏览文件真是太好了。 我当然没有精力/时间从头开始为此编写一个 dired 接口(即使在 dired.el 源的帮助下)。 我的问题是:如果可能的话,我如何通过重新实现一些函数来粘贴到 dired 接口中,为上面的输出创建一个类似 dired 的接口?
我当然不期望这里有完整的解决方案,而是指向示例、教程和其他有用信息的指针。
The ROOT data analysis framework commonly used in high energy physics uses a binary file format that has internal structure like a real filesystem (i.e. folder & files). The ls() method output from the program look something like this:
KEY: TH1D name1
KEY: TH1D name2
KEY: TH2D name3
....
Where "TH1D" and "TH2D" etc. are just object type. It'd be so nice to browse the file in a dired-like interface in emacs. I certainly don't have the energy/time to write a dired interface for this from scratch (even with the help of the dired.el source). My question is: if possible, how can I just tape into the dired interface by re-implementing some functions to make a dired-like interface for the output like above?
I'm certainly not expecting a full-solution here, but rather pointers to examples, tutorial, and other useful info.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
archive-mode
或tar-mode
可能是很好的起点。archive-mode
ortar-mode
might be good starting points.如果它与文件系统足够相似,也许您可以编写某种环回驱动程序,它实际上允许您将数据文件安装为文件系统,类似于将 ISO 映像安装为文件系统的方式。 我非常有限的理解是,这在 Linux 下并不是一件非常困难的事情。
If it's similar enough to a filesystem, perhaps you could write somekind of loopback driver taht actually allows you to mount the datafile as a filesystem, similar to the way you can mount an ISO image as a filesystem. My very limited understanding is that this isn't a terribly hard thing to do under Linux.
slac 某人的 xRootdfs 现在似乎正在这样做。
“rootdFS 是用于 Xrootd 存储集群的 Posix 文件系统。它基于 FUSE(用户空间中的文件系统)并在用户空间中运行。”
但我希望您需要 root 访问权限才能加载 FUSE 模块。
xRootdfs from someone at slac seems to do this now.
"rootdFS is a Posix filesystem for an Xrootd storage cluster. It is based on FUSE (Filesystem in Userspace) and runs in user space."
but I expect that you need root access to load the FUSE module.