CurrentFileOffset Returns the byte position, (file address or offset), of the current ISAM record for the specified file. Short Name GETCURP() Type ISAM function Declaration LONG CurrentFileOffset(COUNT datno); Description CurrentFileOffset() returns the byte position, (file address), of the current ISAM record for file datno. Use this if you need to access the current ISAM record with a low-level function. This function has been optimized for the client/server model by maintaining the current record pointer information on the client side in addition to the Server side. When CurrentFileOffset() is used with the client/server model, the client is able to retrieve the necessary value from the local machine in most cases. This reduces network traffic and increases performance. This function is typically used when switching from ISAM to low-level work. When switching back to ISAM level, be sure to call one of the functions in “See Also” below to reset the ISAM buffers. Return CurrentFileOffset() returns the byte position of the current ISAM record. Zero is returned if there is no current ISAM record for the specified datno, or if an error occurs. On a zero return, check isam_err for a non-zero value indicating the error. See “c-tree Plus Error Codes” in the c-tree Plus Programmer’s Reference Guide for a complete listing of valid c-tree Plus error values. Example COUNT datfil; TEXT recbuf[320];
printf("\nfirst Record is at %ld",
CurrentFileOffset(datfil)); Limitations The recbyt parameter in this function is a 4-byte value capable of addressing at most 4 gigabytes. If your application supports HUGE files (greater than 4 gigabytes), you must use the ctSetHgh() and ctGetHgh() functions to set or get the high order 4 bytes of the file offset. See also SetRecord(), ReadISAMData(), GetRecord() |
|||