> You're right.
>
> But if i do a byte by byte comaprision the files (the original vrs the
> modified after i use notepad to take out the test string and then save the
> file) they are still the same?
How are you doing the comparison?
> So if i was removing or altering something other than the 4 byte test string
> surely the file contents would be different.
Yes, and I suspect you'll find they *are* different.
> Is this something to do with the os file system itself?? Other than
> partition types etc, I didn't realise the file system actually "defined" the
> file. I thought the whole idea of the file was that it encapsulated its own
> meaning??
No, I suspect it's more likely to be to do with opening the file in
Notepad, and the way you're comparing the two files.
If you've got two files with the same contents and file A opens up fine
as a JPEG, then I would expect file B to open fine likewise.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Richard Coltrane - 19 Feb 2008 21:34 GMT
Hi there,
Im using a couple of binary reader to loop through each byte in each file in
sequential order and doing a compare on each byte.... although i suspect a
simple hash would work just as well.
Reversing the process as per Hans suggestion gives me back a useable Jpeg
which in turn supports your idea that its notepad... which makes sense....
but i cant find the "difference" between the two files.
Thanks
>> You're right.
>>
[quoted text clipped - 23 lines]
> If you've got two files with the same contents and file A opens up fine
> as a JPEG, then I would expect file B to open fine likewise.
Jon Skeet [C# MVP] - 19 Feb 2008 22:43 GMT
> Im using a couple of binary reader to loop through each byte in each file in
> sequential order and doing a compare on each byte.... although i suspect a
[quoted text clipped - 3 lines]
> which in turn supports your idea that its notepad... which makes sense....
> but i cant find the "difference" between the two files.
That suggests that your comparison code is broken. Could you post it?

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Lasse Vågsæther Karlsen - 20 Feb 2008 07:36 GMT
> Hi there,
>
[quoted text clipped - 7 lines]
>
> Thanks
<snip replies from Jon>
Try using the command line file comparison tool built into Windows:
fc /B a.jpg b.jpg
The /B is just to make sure you're using a binary comparison, since I do
not know the heuristics involved in determining if the files are text.

Signature
Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3