I'd like to edit a binary file in a certain locaiton in the file, however before I start I'd like to clone a file using fread and fwrite commands.
I wrote a script that does that in matlab, I use the fread and fwrite commands with binary flag.
I compare the source and desitnation files with beyhond comapre - the files are not identical.
What am I doing wrong here? I simply read and write the same charecter.
you can simply using a random binary file for this example
binayFilePath = 'D:\srcFile.Bin';
destinationBinaryFile = "D:\dstFile.Bin";
readFileId = fopen(binayFilePath, 'rb');
assert(readFileId > 0);
writeFileId = fopen(destinationBinaryFile, 'wb');
assert(writeFileId > 0);
fileData = fread(readFileId, 1, 'bit64');
writeCount = fwrite(writeFileId, fileData, 'bit64');