适用于 Windows 的内存文件系统
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/909869/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
In-Memory File System for Windows
提问by Joshua Fox
I have a command-line executable which I need to run from Java on Windows XP. It uses files as input and output. But I want to avoid the overhead of file IO, so I thought of an in-memory RAM file system.
我有一个命令行可执行文件,我需要在 Windows XP 上从 Java 运行它。它使用文件作为输入和输出。但是我想避免文件IO的开销,所以我想到了一个内存中的RAM文件系统。
NetBSD has mount_mfs
.
NetBSD 有mount_mfs
.
Could you recommend the most convenient way of doing this?
你能推荐最方便的方法吗?
回答by sleske
You should also consider whether you really need this (premature optimization, yadda, yadda). On all modern operating systems, filesystem I/O is cached anyway, so frequently-used files are essentially as fast as a RAM disk.
你还应该考虑你是否真的需要这个(过早的优化,yadda,yadda)。在所有现代操作系统上,文件系统 I/O 无论如何都会被缓存,因此常用文件本质上与 RAM 磁盘一样快。
Related question (with many good answers): RAM drive for compiling - is there such a thing?
相关问题(有很多好的答案): 用于编译的 RAM 驱动器 - 有这样的事情吗?
回答by Valentin Rocher
Commons VFSprovides handy interfaces to virtual filesystems, inclunding in-memory file system.
Commons VFS为虚拟文件系统提供了方便的接口,包括内存文件系统。