{"id":896,"date":"2021-03-03T08:03:27","date_gmt":"2021-03-02T22:03:27","guid":{"rendered":"http:\/\/www.nickdu.com\/?p=896"},"modified":"2021-03-03T08:03:27","modified_gmt":"2021-03-02T22:03:27","slug":"sharpext4-a-net-library-provides-read-write-linux-ext2-3-4-file-system-from-a-windows-net-application-continue","status":"publish","type":"post","link":"https:\/\/nickdu.com\/?p=896","title":{"rendered":"SharpExt4, a .Net library, provides read\/write Linux ext2\/3\/4 file system from Windows application (continue)"},"content":{"rendered":"\n<p>Follow my last post <a rel=\"noreferrer noopener\" href=\"https:\/\/www.nickdu.com\/?p=890\" target=\"_blank\">SharpExt4, a .Net library, provides read\/write Linux ext2\/3\/4 file system from Windows application<\/a>.<\/p>\n\n\n\n<p>The <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/gkostka\/lwext4\" target=\"_blank\">lwext4<\/a> is a great start point for me (thanks  the <a rel=\"noreferrer noopener\" href=\"kostka.grzegorz@gmail.com\" target=\"_blank\">author of lwext4<\/a>), and it provides the core implementation of Linux ext2\/3\/4 filesystem. <\/p>\n\n\n\n<p>What I need to do:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>To port the entire lwext4 project over to Visual Studio C\/C++ (MSVC) environment, and compile it as a static library.<\/li><li>To create a clr wrapper around the lwext4 static library and compiled as a .Net assembly DLL.<\/li><li>To provide a .Net friendly interface for .Net Application to use.<\/li><\/ol>\n\n\n\n<p>When creating this .Net library, I would like to access not only physical Linux disk directly, but also Linux disk image file.<\/p>\n\n\n\n<p>SharpExt4 provides two open disk APIs: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Open physical Linux disk\nExtDisk SharpExt4.ExtDisk.Open(int DiskNumber);\n\/\/Open Linux disk image file\nExtDisk SharpExt4.ExtDisk.Open(String imagePath);<\/code><\/pre>\n\n\n\n<p>Open Linux disk image allows developer to directly manipulate the saved Linux disk image file, e.g. <a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.org\/software\/operating-systems\/#raspberry-pi-os-32-bit\" target=\"_blank\">Raspberry Pi OS image<\/a> or Debian OS image. The saved Linux disk image must be raw format. This API doesn&#8217;t support Virtual Machine disk files (VHD, VDI, XVA, VMDK, etc).<\/p>\n\n\n\n<p>This API also support open USB\/Hard drive as physical disk by giving disk number. If you have a USB disk or hard drive formatted as ext2\/3\/4 file system, this API allows the developer to read\/write directly.<\/p>\n\n\n\n<p>To be continue&#8230;<\/p>\n\n\n\n<p>Next post: <a href=\"https:\/\/www.nickdu.com\/?p=912\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.nickdu.com\/?p=912<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow my last post SharpExt4, a .Net library, provides read\/write Linux ext2\/3\/4 file system from Windows application. The lwext4 is a great start point for me (thanks the author of lwext4), and it provides the core implementation of Linux ext2\/3\/4 filesystem. What I need to do: To port the entire lwext4 project over to Visual &hellip; <a href=\"https:\/\/nickdu.com\/?p=896\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SharpExt4, a .Net library, provides read\/write Linux ext2\/3\/4 file system from Windows application (continue)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,2],"tags":[],"class_list":["post-896","post","type-post","status-publish","format-standard","hentry","category-net","category-cc","category-it"],"_links":{"self":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=896"}],"version-history":[{"count":0,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/896\/revisions"}],"wp:attachment":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}