BinaryArchiveReader move back to begining of archive

Hi. I was wondering if there is an option to make archive go back to reread it again. @dale would you mind to look at it?

Lets assume i want to add couple more 3dm chunk versions for differet parts of IO - this is breaking change so i need to check if Read3dChunk was ok (should return bool but it is void) but lets say i can detect later if read went wrong or use ReadErrorOccured (actually do i set it or archive sets it on its own also if error happened). Anyway … At some point i find i should use different scheme so how do i go to the begining of archive?

As interesting finding i can mention that in case of faulty Read3dmChunkVersion it should throw while in my case i just get some unusable numbers. Probably only because earier at this point i had WriteInt but that’s just my suspicion.

1 Like

I’ve never used it, but I see there are multiple methods that allow seeking, and these probably allow you to start from the beginning when you use SeekFromStart(0).

1 Like

Thanks for tip @menno. I’m still legacy oriented. Hopefully soon this will change. Now i can go with reflection for it. Btw. Is it really 0 ? I mean does it refer to plugin specific archive or overall file?

1 Like

Yes - it works like fseek(0 ,SEEK_SET).

– Dale