C# 从 Windows 写入 ext2 linux 分区

发布于 2024-10-02 14:16:52 字数 98 浏览 1 评论 0原文

我对 C# 很陌生,我需要在 Windows 7 的 EXt2 linux 分区上编写一个文件 (grub)。

执行此操作的好方法是什么?我需要用外部程序挂载分区吗?

I'm quite new to C# and I need to write a file (grub) on an EXt2 linux partition from windows 7.

What is the good way to do such thing? Do I need to mount the partition with external program?

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

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

发布评论

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

评论(5

等数载,海棠开 2024-10-09 14:16:52

我认为您需要使用外部程序安装它,例如: http://www.fs-driver.org/

I think you need to mount it with an external program such as: http://www.fs-driver.org/

筱武穆 2024-10-09 14:16:52

使用 FS-driver 等驱动程序安装驱动器,然后使用标准 C# 文件写入技术对其进行写入。

Mount the drive using a a driver like FS-driver and then write to it using standard C# file writing techniques.

初见终念 2024-10-09 14:16:52

您可以使用 Ext2Fsd 在 Windows 中挂载该分区,然后像写入任何其他分区一样写入。

EXT2FSD 主页

You can use Ext2Fsd to mount the partition in windows, and then write to as you would any other partition.

EXT2FSD Home Page

々眼睛长脚气 2024-10-09 14:16:52

如果您在 Windows 下使用 Total Commander,可用的插件之一是用于访问 ext2/3/4。这里可能已经提到过,但它使得从 Windows 访问 Linux 几乎是透明的。我现在还没有安装它,否则我会看看这个名字。

If you use Total Commander under Windows, one of the available plugins is for accessing ext2/3/4. It's probably already been mentioned here but it makes accessing Linux from Windows almost transparent. I don't have it installed right now or I'd look at the name.

四叶草在未来唯美盛开 2024-10-09 14:16:52

SharpExt4可以帮助您进行Linux文件系统的读写。

一个 .Net 库,提供对 Linux ext2/ext3/ext4 文件系统的完全访问(读/写)

这里是 GitHub 链接
https://github.com/nickdu088/SharpExt4

//Open EXT4 SD Card
//Here is SD Card physical disk number. you can get from Windows disk manager
ExtDisk SharpExt4.ExtDisk.Open(int DiskNumber);
//In your case FAT32 is 1st one, ext4 is 2nd one
//Open EXT4 partition
var fs = ExtFileSystem.Open(disk.Parititions[1]); 

//Create /home/pi/file.conf file for write
var file = fs.OpenFile("/home/pi/file.conf", FileMode.Create, FileAccess.Write);
var hello = "Hello World";
var buf = Encoding.ASCII.GetBytes(hello);
//Write to file
file.Write(buf, 0, buf.Length);
file.Close();

如何使用SharpExt4访问树莓派SD卡Linux分区

SharpExt4 may help you with Linux file system read and write.

A .Net library to provide full access (read/write) to Linux ext2/ext3/ext4 filesystem

Here is the GitHub link
https://github.com/nickdu088/SharpExt4

//Open EXT4 SD Card
//Here is SD Card physical disk number. you can get from Windows disk manager
ExtDisk SharpExt4.ExtDisk.Open(int DiskNumber);
//In your case FAT32 is 1st one, ext4 is 2nd one
//Open EXT4 partition
var fs = ExtFileSystem.Open(disk.Parititions[1]); 

//Create /home/pi/file.conf file for write
var file = fs.OpenFile("/home/pi/file.conf", FileMode.Create, FileAccess.Write);
var hello = "Hello World";
var buf = Encoding.ASCII.GetBytes(hello);
//Write to file
file.Write(buf, 0, buf.Length);
file.Close();

How to use SharpExt4 to access Raspberry Pi SD Card Linux partition

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