need help in file traversal via FTS(3)

Hi friends,
I was trying to traverse a file using FTS(3) . this is the code below.. but I am getting segmentation error in the line fts_read(...) ,
anybody have any idea , why it is?
Please, help me. Thanks in advance.
-------------------------------------------------------------------------------------------------------
Program:
-------------------------------------------------------------------------------------------------------

 FTS *fileStruct;
FTSENT *dirList, *fileInfo;
int ftsResult;  

fileStruct = fts_open\(&argv[1], FTS_COMFOLLOW, 0\); 
dirList = fts_children\(fileStruct, FTS_NAMEONLY\);
do
\{
     fileInfo = fts\_read\(dirList->fts_pointer\);
      fileStruct = fts_open\(\(char * const *\)dirList->fts\_link->fts_name, FTS_PHYSICAL, \(void *\)result\);

}while (dirList->fts_link != NULL);

ftsResult = fts_close\(fileStruct\);

-------------------------------------------------------------------------------------------------------
Result of Debugging:
-------------------------------------------------------------------------------------------------------
Starting program: a.out temp
0x0000000000400b78 in main ()
Current language: auto; currently asm
(gdb)
(gdb) n
Single stepping until exit from function main,
which has no line number information.

-- Done with option processing. -- optind is 1
first non-option arg: argv[1] = 'temp'
200810090259
destination directory path : temp/200810090259
checking
fileStruct is not null

Program received signal SIGSEGV, Segmentation fault.
0x00007fc797a4d5c8 in fts_read () from /lib/libc.so.6
(gdb) bt
#0 0x00007fc797a4d5c8 in fts_read () from /lib/libc.so.6
#1 0x0000000000400f4d in main ()
(gdb) Quit
(gdb)

-------------------------------------------------------------------------------------------------------

It has been resolved.

Thanks
...

Just as an aside - ntfw() and ftw() are the POSIX (ie portable) functions for doing this kind of file tree walk. FTS has some neat features but it won't fly anywhere except linux.