Closed bowring closed 8 years ago
Is it better to leave the file unchanged and do something like this instead?
The problem is the files come with bad headers that point to non-existent schema (they never validate the files with current software). So the bad header has to be stripped out and at that point, it is easier to replace it.
I guess my thought was that keeping things read-only as far as Calamari is concerned simplifies matters. Do we want to add file management as a responsibility?
Also, could you send me an example of one of these files?
Yeah, so I drafted some code that reads the file, replaces the header, writes it out to a temp and then sends the temp along for processing, then deletes the temp - works well even on files that have already been fixed. Then the user's files aren't changed.
Also, I think I am going to remove the option for reading in a file from a URI as an unrealistic possibility for our users.
see attached file
On Sun, Aug 7, 2016 at 12:23 PM, John Zeringue notifications@github.com wrote:
I guess my thought was that keeping things read-only as far as Calamari is concerned simplifies matters. Do we want to add file management as a responsibility?
Also, could you send me an example of one of these files?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bowring/Calamari/issues/33#issuecomment-238091881, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCtY-0ZivheFI8TILEVCi7vTuNNEnV2ks5qdgaXgaJpZM4JZDHm .
👍 I understand now. That all sounds good.
The current header of Prawn files produced by Shrimp software is invalid. The header should be replaced with the following header in order to perform validation against the current schema. Saving the changed file might be an option for the user. Later, if the schema moves to another location, this functionality can be adapted.