Privet Sergey!
Thanks for reply...
As I right understand it might looks like
lcBinary = FILETOSTR(lcFilename)
IF ASC(LEFT(lcBinary,1))=0xFF AND ASC(SUBSTR(lcBinary,2,1))=0xD8
lcBinary = CHR(0x45)+CHR(0x50)+SUBSTR(lcBinary,3,LEN(lcBinary))
STRTOFILE(lcBinary,lcFilename)
ENDIF
Am I right?
>
>I need to replace first bytes in the file (FF D8) to (45 50)
>>This is seems blank in my education ;)
>>Can you study me next:
>>
>>1) How to check - is first byte is FF and second is D8. FGETS() ?>
>lcByte1 = FREAD(lhFileIn,1)
>IF ASC(lcByte1) = 0xFF
> lcByte2 = FREAD(lhFileOut,2)
> IF ASC(lcByte2) = 0xD8
> ...
>
>
>2) How to replace one byte to another in file and save it?>
>Write out to another temp file using FREAD() and FWRITE() and than delete original and rename temp.
>
>IF file is not big, you can use FILETOSTR() and STRTOFILE() to do all that in the memory.