Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: 3327 Error Offset beyond Binary EOD Error
iptest = FileOpen("C:\TEMP\mergedlog.txt", "READ") time = FileOpen("C:\TEMP\time.txt", "WRITE") file = FileOpen("C:\TEMP\ipconfig.txt", "WRITE") FileClose(file) mergedlogsize = FileSize("C:\TEMP\mergedlog.txt") binarybuffer = BinaryAlloc(mergedlogsize / 5) BinaryRead(binarybuffer, "C:\temp\ipconfig.txt" ) FileWrite(time, TimeDate()) x= BinaryEodGet(binarybuffer) BinaryEodSet(binarybuffer, x + 1) thefirsttime = @TRUE While @TRUE textline = FileRead(iptest) If textline == "*EOF*" Then Break testip = ItemExtract(3, textline, " ") temp = StrCat(testip, @CRLF) If BinaryStrCnt(binarybuffer, 0, x - 1, temp) == 0 Then BinaryPokeStr(binarybuffer, x, temp) EndWhile FileWrite(time, TimeDate()) FileClose(time) FileClose(iptest) BinaryWrite(binarybuffer, "C:\TEMP\ipconfig.txt") BinaryFree(binarybuffer)testip is retrieved from a file and is just a run of the mill IP address. The error I get is on the If statement saying 3327 Error: Offset beyond binary EOD. This is on the first iteration of this code.
One other thing is that it's adding a space to the first piece of data in the output file. Any ideas on how to get rid of this?
x=BinaryEodGet(binarybuffer) BinaryEodSet(binarybuffer, x + 1)delete it. It's bumping the EOD point past the end of valid data. The problem will show up in the first line of added data.
x= BinaryEodGet(binarybuffer) If x > 0 If BinaryStrCnt(binarybuffer, 0, x-1, temp) == 0 Then BinaryPokeStr(binarybuffer, x, temp) Else BinaryPokeStr(binarybuffer, x, temp) EndIf
Article ID: W14826
File Created: 2002:12:12:14:55:36
Last Updated: 2002:12:12:14:55:36