• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deal with invalid data in data file

 
Jin Zhang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

My data file spec says:
2 byte flag. 00 implies valid record, 0x8000 implies deleted record
and the create() method in the given interface asks me to reuse deleted record's space.

How should I deal with those invalid records? If (flag != 0 && flag != 0x8000), should I treat it as deleted record thus to reuse its space or leave it untouched?

Thanks.

Cheers,
Zhang Jin
 
Denis Spirin
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you may check this and throw exception to indicate that file is corrupted.
But you also may not care about that. There is no such requirement in instructions.
 
Jin Zhang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Denis,

Thanks.

I think I will leave it untouched. Because it maybe marked invalid by the legacy system. But I will put it in my document.

Cheers,
Zhang Jin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic