how to determine if a object dir or file is? - WeOnlyDo Discussion board

how to determine if a object dir or file is? (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Jan, Thursday, February 17, 2005, 12:00 (7218 days ago)

Hello,

I have now a list of objects created with
ListNames() method.

I must know, if a list member dir or file is.

So, I check an exception:
try
{
bDir = false;
if(!pFtpCom->CheckDir(lpTestDir))
{
bDir = true;
}
} catch(...){pFtpCom->PutLastError(0);};

if(!bDir)
try
{
pFtpCom->GetFile(vLclDir,name);
}
catch(...)
{
pFtpCom->get_LastError(&LastError);
_bstr_t err = pFtpCom->GetErrorText(LastError);
printf( ( d ) s
,LastError,(LPSTR)err);
pFtpCom->PutLastError(0);
}
}

It works with error:
If the first item found is a dir, and the next one a file,
it will be the next exception thrown. It should not!

If the first item found is a file, it will be get without any exception.

Is there any other workaround, how to determine if an list item
dir or file is?

Thanks
Jan

[:wink:]


Complete thread: