|
Post by bjonte on Dec 11, 2020 21:44:51 GMT
I’m glad we’re all on the same page now.
Yes, I agree that the interesting question is why do you need the exact file size, mirkosoft? Perhaps there’s a better way to design your program to get rid of that difficult requirement.
|
|
|
Post by wsoft on Dec 12, 2020 0:08:24 GMT
I am sorry if I offended Mirkosoft (or any of you others) by my posts. The original question was how we could get to the end-address without loading the entire file and I am sorry I didn't post clearly. But yes, I still wonder how this information would be an advantage to anyone.
P.S. I do maintain my original point that the end of the file can be determined by a continuous read of track and sector pointers, and that there is no other, or faster way for larger files.
|
|
|
Post by gsteemso on Jan 20, 2021 18:56:37 GMT
I do maintain my original point that the end of the file can be determined by a continuous read of track and sector pointers, and that there is no other, or faster way for larger files. Agreed! That's pretty much exactly what I was trying to describe, though I have to admit, when I start expounding upon such things I tend to be very unfocussed, with a lot of excess detail, and frequently get side-tracked with interesting but not-totally-germane tangents. With respect to "EOF": For some reason, my brain interpreted that as "an EOF character within the data-stream being loaded", as I'm told is the convention on systems such as UNIX. The "end of data" flag in BASIC's "STatus" variable does indeed indicate EOF, just as you say. I somehow missed that that's what you meant. In short, I'm sorry for having been even less clear than usual. (I hadn't actually realized I _could_ come across that much less coherently than I usually manage. Rereading my post with a slightly clearer head was an unpleasant surprise.)
|
|
|
Post by wsoft on Feb 1, 2021 23:49:11 GMT
👍 What, me worry? Thanks for caring about Commodores, bud. And hey be safe out there. I feel like I live in Alaska or something.
Oh yeah, Bjonte found the answer, not me.
|
|
|
Post by wsoft on Jun 13, 2021 12:59:54 GMT
Getting end address from PRG, SEQ and USR is the same. You have to read the two first byte in each sector of the file until you get the end marker. In essence this means reading the whole file without storing it, unless you plan to upload some custom code to the drive that can do it slightly faster by only decoding the first two bytes of the sectors. It isn’t possible to get the file size in any compatible way other than reading these sector links, one way or another. Looks like you knew the beginning from the end. Respect.
|
|