To see the type of the archive file, the program first looks at the "magic number" at the start of the file to see if it can identify it. If that fails, then it looks at the suffix of the file name. If your RAR files are not recognized by their magic number and have to have the suffix changed, then maybe they have a different magic number at the beginning than is being looked for. In my code, I am looking to see if the first four bytes in the file are "Rar!" (i.e. 0x52 0x61 0x72 0x21) to identify it as a RAR file. Can you see if the files that need to have their suffix changed to .cbr have a different magic number at the beginning?
|