Comments (11)
What exception did you receive? I haven't tried two images at the same time. One temp solution is to save the files to your local drive and then transfer to the new image
from sharpext4.
I tried saving them to the local disk but I would need to keep the file permissions, that way they are lost.
There are two kinds of exceptions(I assume there is a static pointer used by both):
1) Could not read disk MBR
var d1 = ExtDisk.Open(@"C:\Users\Giacomo\Downloads\raspbian_1.img"); var fs1 = ExtFileSystem.Open(d1.Partitions[1]); var d2 = ExtDisk.Open(@"C:\Users\Giacomo\Downloads\raspbian_2.img"); var fs2 = ExtFileSystem.Open(d2.Partitions[1]);
The exception is generated at line 3
2) Could not register partition.
var d1 = ExtDisk.Open(@"C:\Users\Giacomo\Downloads\raspbian_1.img"); var d2 = ExtDisk.Open(@"C:\Users\Giacomo\Downloads\raspbian_2.img"); var fs1 = ExtFileSystem.Open(d1.Partitions[1]); var fs2 = ExtFileSystem.Open(d2.Partitions[1]);
The exception is generated at line 4
from sharpext4.
Probably yes.
When you transfer the file, keeping file permissions in a Dictionary<path, permission> in the memory, after the transfer, you can use
setmode to set the original permission.
from sharpext4.
Yes of course but it would be much more convenient to move files directly between images.
Do you think it would be possible to fix the problem?
from sharpext4.
I need take a look.
from sharpext4.
Yes of course but it would be much more convenient to move files directly between images.
Do you think it would be possible to fix the problem?
This is the limitation of lew4. It only can take one disk image at a time, because the underline implementation is C. All variables are global variable and shared across the library.
from sharpext4.
I tried to view the code, are you sure it is not a SharpExt4 problem?
I noticed that in the ExtDisk.cpp file on line 56
auto disk = gcnew ExtDisk(imagePath);
disk->bd
always has the same pointer, they seem to me declared satatic in the io_raw.cpp file
from sharpext4.
I tried to view the code, are you sure it is not a SharpExt4 problem? I noticed that in the ExtDisk.cpp file on line 56
auto disk = gcnew ExtDisk(imagePath);
disk->bd
always has the same pointer, they seem to me declared satatic in the io_raw.cpp file
I have done the quick fix. It seems working ok on my side. Let me know if you still have the issue.
from sharpext4.
It now allows you to open two filesystems, the problem is that it always displays the last opened disk.
var disk1 = ExtDisk.Open(@".\disk1.img");
var disk2 = ExtDisk.Open(@".\disk2.img");
var fs1 = ExtFileSystem.Open(disk1.Partitions[1]);
ListAllFiles(fs1);
CreateFile(fs1);
var fs2 = ExtFileSystem.Open(disk2.Partitions[1]);
ListAllFiles(fs2);
ListAllFiles(fs1);
View files in disk 2
CreateFile(fs1);
Create the file in disk 2
In my project, the same pointer for ExtDisk.bd always remains.
from sharpext4.
It now allows you to open two filesystems, the problem is that it always displays the last opened disk.
var disk1 = ExtDisk.Open(@".\disk1.img"); var disk2 = ExtDisk.Open(@".\disk2.img"); var fs1 = ExtFileSystem.Open(disk1.Partitions[1]); ListAllFiles(fs1); CreateFile(fs1); var fs2 = ExtFileSystem.Open(disk2.Partitions[1]); ListAllFiles(fs2);
ListAllFiles(fs1);
View files in disk 2CreateFile(fs1);
Create the file in disk 2In my project, the same pointer for ExtDisk.bd always remains.
Hope this time, this issue get fixed. I did a quick test, and it's working.
The ExtFileSystem.Open
API has been updated.
from sharpext4.
Perfect everything seems to be working correctly, many thanks
from sharpext4.
Related Issues (20)
- Unhandled Exception while disposing ExtFileStream HOT 7
- Could not read disk MBR error HOT 9
- Could not mount partition error when read Flash Usb Ext4 HOT 1
- Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. HOT 6
- (It can be simply modified to be compiled in Visual Studio 2013). How? HOT 4
- Error: Could not load file or assembly 'SharpExt4.dll' or one of its dependencies. The specified module could not be found. HOT 5
- Could not load file or assembly 'SharpExt4, Version=1.0.8402.18282 HOT 12
- How to read and write ext4 in vmdk HOT 4
- Unable to recognize EXT4 extended partition HOT 9
- Update Docs and cannot mount ext4 partition HOT 11
- Typo on ExtDisk "Partitions" getter HOT 1
- Add support for MBR disk type
- Is this library being actively maintained? HOT 1
- Open partition from a file system image? HOT 2
- Cannot mount ext4 partition HOT 9
- en/decryption support? HOT 1
- Could Not Read Disk MBR HOT 1
- GPT partition HOT 8
- ext4 for bootmgr.efi (Windows 7, 8, 10, 11) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpext4.