- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Suppose I have a file with 10039 bytes in it, and specify a record size of 100 bytes.
If I open it with ACCESS=DIRECT, then I can process 100 records OK, but how do I process the
leftover 39 bytes?
In other words, what is it supposed to do when I specify reading record no 101?
Does it read the leftover 39 bytes and give back an error message?
Of course, expecting the no of bytes to come out even would not be realistic.
The file size could even be a prime number.....
If I open it with ACCESS=DIRECT, then I can process 100 records OK, but how do I process the
leftover 39 bytes?
In other words, what is it supposed to do when I specify reading record no 101?
Does it read the leftover 39 bytes and give back an error message?
Of course, expecting the no of bytes to come out even would not be realistic.
The file size could even be a prime number.....
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is supposed to happen is that you get an error. The fate of the 39 bytes is undefined.
I would suggest opening such a file for stream access, reading 100 bytes at a time and then you can read the remaining 39 bytes without much difficulty.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page