DKRead and DKWrite

Demonstrates how to read and write a file.

Remarks

This example illustrates how to read and write a binary file.

Code

 local byte ptr buffer, int tfid, int size

 size = DKSize("PRM.PRM")

 buffer = EAlloc(byte,size)

 tfid = DKOpen("PRM.PRM","r")
 call DKRead(tfid, buffer, 0, size)
 call DKClose(tfid)

 tfid = DKOpen("PRM2.PRM", "w")
 call DKWrite(tfid, buffer, 0, size)
 call DKClose( tfid )

 call EFree(buffer)

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.