This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CF programming

Hi all,
Can any one tell how to implement search command for data search from compact flash card?

Parents
  • 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.

Reply
  • 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.

Children