The easiest way would be to rewind the ptr by using the FileRewind() or the
other way would be to close the File before reading...
-vishy
Hi
I want to use File Streaming API in my application. I have
tried with FileWrite( ) and FileRead( ) calls. I am able to write some
bytes into a file. But reading that file always returns zero objects.
I didn't got any errors also. Can anybody suggest some way to do this.
The code follows:
int file(void)
{
FileHand tmpFile = NULL;
Int32 written, read;
char write_buffer[4] = "abcd";
char read_buffer[4] = " ";
tmpFile = FileOpen (0, "ptt1.txt", 0, 0, fileModeReadWrite, NULL);
if (tmpFile == NULL)
{
printf("Error opening file");
}
written = FileWrite (tmpFile, (void *)write_buffer, 1, 4, &err);
printf("Bytes Written = %d.\n",(int)written);
read = FileRead (tmpFile, (void *)read_buffer, 1, 4, &err);
printf("Bytes Read = %d.\n",(int)read);
err = FileClose(tiffFile);
return 0;
}
debugging returns err = 0
Thanks in advance
venkatesh
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/