Consultor Eletrônico



Kbase P159641: Seek function returns erroneous results
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/05/2010
Status: Unverified

SYMPTOM(s):

Seek function returns erroneous results

Using IMPORT and SEEK function in same program

Result is always 0 as the length

FACT(s) (Environment):

Program works on version 10.1B
Red Hat Enterprise Linux ES 3.1
OpenEdge 10.1C04 Service Pack
OpenEdge 10.2A
OpenEdge 10.2B

CAUSE:

Bug# OE00195223

CAUSE:

An internal function's parameter was not updated to take CLIENTOFFSET type for all offset input parameter.

FIX:

As a workaround, after the IMPORT and just before the SEEK STREAM <stream-name> to END, perform a SEEK STREAM <stream-name> to i-posAfterImport.
i-posAfterImport is an integer storing the position of the last byte of the file:

/* code */

define stream i-s-paq.
input stream I-S-PAQ from value("/usr/wrk/myFile.r") binary no-convert.


/*workaround */
def var i-posApresImport as int.
seek stream I-S-PAQ to i-posApresImport.
i-posApresImport = seek (i-s-paq).
/*end of workaround */

seek stream I-S-PAQ to end.
MESSAGE "file size (bytes): " seek ( I-S-PAQ ) view-as alert-box information.


input stream I-S-PAQ close.

/* end of code */