Open fengjiannan2010 opened 2 months ago
dataDisc.ImageLayout
is null because the ImageLayout (i.e. the file system tree) has not been set or loaded. dataDisc.LoadTrackLayout
just instructs DataDisc to load the file system later from the corresponding disc track. That will happen at the time of next WriteToDisc()
call.
See: https://doc.primoburner.com/net/latest/class_primo_software_1_1_burner_1_1_data_disc.html
If you have to use BlockDevice
then you need to keep track of all the files that you manually write and use that information to create the file layout yourself, then pass the layout you created when you call BlockDevice.FinalizeDisc
For an example of how to create the file layout see the CreateFileSystem method in the legacy BlockDevice sample available here: https://github.com/primoburner/primoburner-samples-legacy/blob/main/windows/cpp/samples/BlockDevice/main.cpp#L384
We are in the process of porting all legacy samples to v5.0 but unfortunately have not gotten to do that for the .NET BlockDevice sample yet.
In general, I would study the BlockDevice sample. I think it pretty much covers your use case. Once you can run it for files just update the code to read file data from the network and you should be good.
I have used this sample code: https://github.com/primoburner/primoburner-samples-legacy/blob/main/windows/net/samples/BlockDevice/MainClass.cs#L337 Now I can burn and read files. I recorded the address and size of the file myself, and used BlockDevice.FinalizeDisc to write the file system layout. I hope you can provide an interface to get the address and size of the burned file through the CD. , so that I can append the file system layout using BlockDevice when burning multi-session
LoadLastTrackLayout and DataDisc get ImageLayout is null
Is the method I'm using incorrect? Can you provide me with a Demo? My requirement is that the burned data cannot be written to the HDD. The data needs to be read directly through the network and written to the disc, so I use BlockDevice for data writing. I need to retain already written data and append write new data.
Windows 11 x64 .net core