find depth using ftw

Hello,

I am looking for specific files in my tree directory using ftw(3). How do I know how deep I am in the file structure.. in other words, say I am looking for config.txt files, and my structure looks like this..

/some/directory/user1/config.txt
/some/directory/user2/config.txt
....
/some/directory/user1/another/directory/config.txt
.....

How can I distinguish inside my callback function the depth in my structure, and handle the later example in a different way?

Thank you for your help..

-----
German Escallon
Software Developer
Adtec Digital Inc.

ftw(3) does not provide this information. However, nftw(3) does. It passes the following structure to your custom function as the 4th argument.

struct FTW {
    int base;
    int level;
}; 

where base is the offset of the filename (i.e., basename component) in the pathname given in fpath. level is the depth of fpath in the directory tree, relative to the root of the tree (dirpath, which has depth 0).

It worked like a charm. Thank you for pointing that out.
~G