L
Liang Zhang
HI, ALL
I found a surprising problem when using function "_tfindfirst()" and
"_tfindnext()" to enumerate all the files in a specified directory, the code
is like below:
handle = _tfindfirst(searchdir,&filefind);
if (handle != -1)
{
do
{
// if (_A_SUBDIR != filefind.attrib)// is a jar file
{
_tcscat(destParams, jarPath);
_tcscat(destParams, _TEXT("\\"));
_tcscat(destParams, filefind.name);
_tcscat(destParams, ";");
}
} while (0 ==_tfindnext(handle,&filefind));
}
else
{
LOG("Cannot find the jar files from search path below");
LOG(searchdir);
}
_findclose(handle);
this code piece will be executed twice in my program, and in the first pass,
it works well, however, it fails in the second pass. and the searchdir is
the same one and the target directory is kept intact, i don't know why this
happens, could you have any suggestions?
--
Best Regards
Liang Zhang
Developer
SAP Labs China
T: +86 21 61006699-7775
F: +86 21 65984520
Email (e-mail address removed)
SAP LABS CHINA : INNOVATE THE FUTURE
I found a surprising problem when using function "_tfindfirst()" and
"_tfindnext()" to enumerate all the files in a specified directory, the code
is like below:
handle = _tfindfirst(searchdir,&filefind);
if (handle != -1)
{
do
{
// if (_A_SUBDIR != filefind.attrib)// is a jar file
{
_tcscat(destParams, jarPath);
_tcscat(destParams, _TEXT("\\"));
_tcscat(destParams, filefind.name);
_tcscat(destParams, ";");
}
} while (0 ==_tfindnext(handle,&filefind));
}
else
{
LOG("Cannot find the jar files from search path below");
LOG(searchdir);
}
_findclose(handle);
this code piece will be executed twice in my program, and in the first pass,
it works well, however, it fails in the second pass. and the searchdir is
the same one and the target directory is kept intact, i don't know why this
happens, could you have any suggestions?
--
Best Regards
Liang Zhang
Developer
SAP Labs China
T: +86 21 61006699-7775
F: +86 21 65984520
Email (e-mail address removed)
SAP LABS CHINA : INNOVATE THE FUTURE