Im a bit of a beginner in rust, i know some of the basics of reading files etc. But im trying to figure out the following.
I need to:
- search for the first occurrence of a particular byte pattern or a string converted into its ascii representation in an open file.
- As soon as i find the first occurrence i want to break and return its index.
- The files are very, very large up to 500/600gb.
I have never written anything like this before so im not really sure where to get started. Usually when i have been able to do searches you can read the entire file into memory and then search, but this time i can't and i guess need to read it into chunks?
For instance how should i deal with the intersection between two chunks? If there is a crate that can do this, its welcome, but im open to writing it myself if needed to learn.
The problem is i have no idea how to think, or where to start? Anyone that could help a noob with some guidance?