We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, Can any one tell how to implement search command for data search from compact flash card?
I want to find a specific file name on the card. If possible give me the source code for CF implementation
You want to find a specific file name?
1) You know the full name of the file?
2) Or you know the file name, but not in what directory it may be located?
If 1, then just open the file.
If 2, then you need to walk through all directory entries. But the code needed to do that is depending on what code you have to implement the file system support. I asked in my first post about this, but you still haven't answered: Exactly what code are you using to access the file system? Or don't you have any code at all to support accessing CF memory and accessing the file system on the CF memory?
Thanks for u r early response. Implementing FAT 16 file system. Want a command to search particular file from CF card by giving total path of the file. I am placing a file in a directory. While searching that file I know total path where I placed it. EX: I have a file “test.txt†in \time\min\sec\test.txt I want to get the file test.txt present in given directory path.Implementing the code in c language.
If you are implementing a FAT16 file system, then obviously no one but you can write example code for implementing the underlying code for an fopen() function using your file system?
Locate root directory. Read first cluster. Scan for file name - or first directory in the path of your file name. If not found, locate next cluster of root directory repeat the search.
If file found in root directory, then you are done. If not, locate first cluster of the subdirectory where the file is in. Read in and scan for the file name (or next level of the path).
Repeat the above until you either fail (path or file missing) or you have found the file.
If file is found, then you know the start cluster of the file. The FAT table will contain the chain of clusters to follow. The directory entry will contain the size of the file, which implies the number of clusters used by the file.
thanks for your support