× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On a PC the way to handle this is to read the file byte by byte when you
don't know the length.  I'm not sure how you're reading this file, what
instructions you're using, but there are also similar ways around it.  If
you can get the file length, you won't have a problem of course, as you
could read your 10000 bytes til you see you can't read that much, then read
the number of bytes available.

I'm not real familiar with MI and what it can do, but have a bit of
familiarity with binary PC files.  Does MI give you the record number you're
own?  If so, why not save the record number, read your 10000 bytes until you
receive CVP5001, then position back to the last valid record number you read
and read byte for byte until you get CVP5001 again.

If MI is not capable of this, perhaps you could call the C file I/O APIs to
do it for you.

HTH.

Regards,

Jim Langston

-----Original Message-----
From: Leif Svalgaard [mailto:leif@leif.org]

Folks,
Problem:  a file is uploaded (binary) from a PC.
I need to read it in MI to parse out the data.
The size of the file is not known, I need to read until
the end. I define a record size of (say) 10000 and
start reading. I get the CVP5001 exception as usual
at the end of the file, but the last (incomplete) block
I don't get. How to get it?


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.