From: Gareth on
Hello,

I want to know if it's possible to reconstruct a disk image file using the layout given in an XML file.
Here is a snippet of that XML file:

<Sector>
<Start>0x0</Start>
<Sectors>8</Sectors>
<File>"ImageData0.dat</File>
<File_Offset>0</File_Offset>
</Sector>

<Sector>
<Start>0x8</Start>
<Sectors>54</Sectors>
<Decoding_Info>
<Pattern_32Bit>0x0</Pattern_32Bit>
</Decoding_Info>
</Sector>

What the first part is saying is 'From sector 0, for 8 sectors, write data from 'ImageData0.dat' to the reconstructed file.
The second part is saying 'from sector 8, for 54 sectors, write a pattern of zeros to the reconstructed file.

So essentially what I want to be able to do is to use the sector map that I have been given of the original media (the XML file), and use the values within that (as listed above) to write to a new file that will (hopefully) end up being an exact copy of the original image file.
Can I do this using Matlab?
From: Rune Allnor on
On 16 apr, 14:20, "Gareth " <gmj...(a)hotmail.co.uk> wrote:
....
> Can I do this using Matlab?

Yes.

Rune
From: Gareth on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <570b5006-17e9-4aa7-ba93-05824fce7e57(a)b33g2000yqc.googlegroups.com>...
> On 16 apr, 14:20, "Gareth " <gmj...(a)hotmail.co.uk> wrote:
> ...
> > Can I do this using Matlab?
>
> Yes.
>
> Rune

The early signs are positive then!
What I am failing to grasp is how to get, say, the pattern of zeros written 'as' the file as opposed to being written as part of the file content.
From: Rune Allnor on
On 16 apr, 15:07, "Gareth " <gmj...(a)hotmail.co.uk> wrote:
> Rune Allnor <all...(a)tele.ntnu.no> wrote in message <570b5006-17e9-4aa7-ba93-05824fce7...(a)b33g2000yqc.googlegroups.com>...
> > On 16 apr, 14:20, "Gareth " <gmj...(a)hotmail.co.uk> wrote:
> > ...
> > > Can I do this using Matlab?
>
> > Yes.
>
> > Rune
>
> The early signs are positive then!
> What I am failing to grasp is how to get, say, the pattern of zeros written 'as' the file as opposed to being written as part of the file content.

XML files and ASCII codes are only conventions for communicating
information. We are communicating in English, which means there
are certain rules about vocabulary and grammar that are typical
for that language. The difference between English and, say, German
is exactly vocabulary and grammar.

XML is nothing more than a set of grammars. Not even a vocabulary.
If you want to find out what the XML file expresses, you will need
to find out what vocabulary the author of that file used. Once you
do that, it will become more or less obvious what to do with the
contents of the file.

Rune
From: Gareth on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <2ee7b505-0417-4829-a9b2-a03fb5591489(a)z3g2000yqz.googlegroups.com>...
> On 16 apr, 15:07, "Gareth " <gmj...(a)hotmail.co.uk> wrote:
> > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <570b5006-17e9-4aa7-ba93-05824fce7...(a)b33g2000yqc.googlegroups.com>...
> > > On 16 apr, 14:20, "Gareth " <gmj...(a)hotmail.co.uk> wrote:
> > > ...
> > > > Can I do this using Matlab?
> >
> > > Yes.
> >
> > > Rune
> >
> > The early signs are positive then!
> > What I am failing to grasp is how to get, say, the pattern of zeros written 'as' the file as opposed to being written as part of the file content.
>
> XML files and ASCII codes are only conventions for communicating
> information. We are communicating in English, which means there
> are certain rules about vocabulary and grammar that are typical
> for that language. The difference between English and, say, German
> is exactly vocabulary and grammar.
>
> XML is nothing more than a set of grammars. Not even a vocabulary.
> If you want to find out what the XML file expresses, you will need
> to find out what vocabulary the author of that file used. Once you
> do that, it will become more or less obvious what to do with the
> contents of the file.
>
> Rune

Thanks for the replies. I know what the file expresses, it is telling me what data (or zeros) each sector of the original image file (disk image; I should have stated this earlier) contains; my problem is trying to put this into code. How can I create a file that isn't an .m file and say for example, 'write zeros for the first 54 sectors of this file, then write the first part of 'file x' to the next 10 sectors, then write another 25 sectors worth of zeros'