On unix-like systems, you'd be able (only as root, most likely) to read the disk files /dev/{h,s}d* and write whatever byte sequence you want to them, including byte sequences that represent a, say, ext3 file system.
I don't know of any ext3 libraries in Java, though, so you might have to write it yourself. Or a library for the file format you care about.
This is probably not what you want, though, but you can settle for it :-)
发布评论
评论(3)
这是非常特定于系统的,没有通用的方法来执行此操作。您的选择是
It is very system specific, there is no universal way to perform this. Your options are
不直接。您将需要调用操作系统特定的程序来为您完成实际工作。
Not directly. You will need to invoke a operating system specific program to do the actual work for you.
在类 Unix 系统上,您能够(最有可能仅以 root 身份)读取磁盘文件
/dev/{h,s}d*
并写入您想要的任何字节序列,包括代表 ext3 文件系统的字节序列。不过,我不知道 Java 中有任何 ext3 库,所以你可能必须自己编写它。或者您关心的文件格式的库。
不过,这可能不是您想要的,但您可以接受:-)
On unix-like systems, you'd be able (only as root, most likely) to read the disk files
/dev/{h,s}d*
and write whatever byte sequence you want to them, including byte sequences that represent a, say, ext3 file system.I don't know of any ext3 libraries in Java, though, so you might have to write it yourself. Or a library for the file format you care about.
This is probably not what you want, though, but you can settle for it :-)