Re: ListDirData Event - WeOnlyDo Discussion board

Re: ListDirData Event (General questions)

by David Lucas, Wednesday, December 22, 2010, 09:43 (5086 days ago) @ woddrazen

Thank you for the example, unfortunately it didn't help much, but I was having a look at the source code for wodFTPD and I've made a little more progress.

My event handler now looks like this:

void __fastcall TForm1::ServerListDirData(TObject * Sender, IFtpUser* User,
OleVariant &DirData, OleVariant &NamesOnly)
{
AnsiString ClientFileList = -rw-rw-rw 1 root root 449 Aug 18 14:04 test.txt

rw-rw-rw 1 root root 40939 Jan 18 12:02 test.html ;

DirData.ArrayRedim(ClientFileList.Length()+1);

void *pBuff = DirData.ArrayLock();
memcpy(pBuff, ClientFileList.c_str(), ClientFileList.Length());
((char*)pBuff)[ClientFileList.Length()] = '';
DirData.ArrayUnlock();

NamesOnly.VBoolean = true;
}


While this actually changes what my client displays (I'm using WinSCP), it's still not right, as the file names come out as follows:
-rw-rw-rw 1 root root 449 Aug 18 14:04 test.txt rather than just text.txt .

Any suggestions? I'm using a fairly old version, 2.1.9.103, but couldn't see anything in the release notes regarding the ListDirData event.


Regards,

David Lucas


Complete thread: