01-25-2013 08:37 AM
Similar to how Microsoft allows one to search a folder of documents for words inside of a document, I wonder how this can be done in LabVIEW. LabVIEW has binary seek capability to go to a particular byte location in a file on a hard drive. But what would be a good strategy for searching the hard drive for a string without bringing the file bytes into memory?
Don
01-25-2013 09:19 AM - edited 01-25-2013 09:20 AM
That's sort of like saying, I want to go swimming but don't want to get wet. ![]()
Windows can do a lot of things (I suspect) because they have much more direct access to the disks than applications do. For example, the ability to search the contents of files in Windows is limited to plain text files. This leads me to think that Windows is scanning the disk contents directly without worrying about file structure. When it finds the string you are looking for, it then looks to see what file its in.
Mike...
01-25-2013 12:14 PM
You're going to have to read the file into memory - that's unavoidable. You don't have to read the entire file into memory at once, though - you can read a short section, search for item you want, then move on to the next chunk of the file. To avoid the problem of the search phrase crossing the boundary of a chunk, overlap the chunks slightly. I'd guess that's what Windows does too - MikePorter's comment doesn't make much sense to me.