On 08/11/2018 08:42 PM, Greg Freemyer wrote:
David,
That was fantastically nice of you to put that together for me.
Thank you, Greg
Sure Greg, Glad to help. I have helped with C questions on StackOverflow over the years and have a number of small bits of code that can be sewn together to help. That's the fun part of the day. Let me know if it needs tweaking or if speed is an issue on large files and I can pop a sendfile or mmap implementation in to help speed up copy of the good data to a new file. Either can provide solid reduction in copy time if the good data parst of teh files are larger than tens or hundreds of megabytes. As is C uses a BUFSIZ read buffer for basic file I/O to read data in good sized chunks to begin with (8192 bytes on Linux/512 bytes on windoze). So if this is a one pass deal, the performance gains aren't needed. If this is continual issue and you may need to scan multiple files every 3 seconds, etc., then it's worth the additional code. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org