LinqToStdf
LinqToStdf copied to clipboard
Error unconverting Tsr
Hi Mark, The UnConvertor for TSR records has a minor bug/error. Bits 3, 6 and 7 of the OPT_FLAG should be set to 1 in all cases. Currently, the UnConvertor determines this value based on the validity of the subsequent fields. There's no definition for a base value that is modified by the valid field mask.
This isn't really a big problem as nobody uses those extra bits with the current STDF standard However, technically, it is an error and it gets flagged when I do STDF integrity/compliance checks. I couldn't come up with an elegant solution for this - other than creating an explicit record convertor that didn't use attribute decoration.
I have another UnConvertor problem in that I have GDR records that actually contain padding bytes. As you know, the current GDR UnConvertor doesn't support padding bytes. Any suggestions as to the best way to solve that? I thought I'd ask before I hack something together as I know you are aware of the problem and may already have some ideas.
Regards Rob
I think the solution to padding in GDR would be to have a GDRPadding type that is understood by the unconverter. LinqToStdf's treatment of padding is based on an assertion that there aren't modern scenarios for padding. What's your padding scenario?
The TSR situation is pretty interesting. I was never very happy with how flags were set. I'll have to think about that.
Hi Mark, I implemented a tacky fix/workaround for the GDR padding by adding the following to the start of the Gdr unconverter:
if (o is null) { writer.WriteByte((byte)0); } else if (o is byte) { …
This solves my immediate problem. That said, I agree that having a GDRPadding type would be more elegant.
The padding scenario is this particular record is rather bizarre. The ‘padding byte’ is present in all cases. I suspect the person who generated this GDR didn’t quite understand the purpose of padding bytes as an alignment technique. For my needs, I just need to pass the GDR, from reader to writer, untouched.
From: Mark Miller [email protected] Sent: Saturday, October 06, 2018 7:24 PM To: marklio/LinqToStdf [email protected] Cc: Rob WADSWORTH [email protected]; Author [email protected] Subject: Re: [marklio/LinqToStdf] Error unconverting Tsr (#8)
I think the solution to padding in GDR would be to have a GDRPadding type that is understood by the unconverter. LinqToStdf's treatment of padding is based on an assertion that there aren't modern scenarios for padding. What's your padding scenario?
The TSR situation is pretty interesting. I was never very happy with how flags were set. I'll have to think about that.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/marklio/LinqToStdf/issues/8#issuecomment-427615880, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AUSJK2gC7wdY6fKnhs7vZJ0LXsfhCsJ5ks5uiUmygaJpZM4XLiex.
Null seems like a reasonable solution. In fact, on further reflection it seems pretty good. A placeholder in the stream. I'd be happy to take a PR for that change
o.k. I'll do that when I've figured out the mechanics. I've never really used Github before.