Re: ListDirData Event (General questions)
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:
- ListDirData Event - David Lucas, 2010-12-21, 11:52
- Re: ListDirData Event - woddrazen, 2010-12-21, 12:17
- Re: ListDirData Event - David Lucas, 2010-12-22, 09:43
- Re: ListDirData Event - David Lucas, 2010-12-22, 09:45
- Re: ListDirData Event - wodDamir, 2010-12-22, 09:55
- Re: ListDirData Event - David Lucas, 2010-12-22, 10:11
- Re: ListDirData Event - David Lucas, 2010-12-22, 10:35
- Re: ListDirData Event - David Lucas, 2010-12-22, 10:45
- Re: ListDirData Event - David Lucas, 2010-12-22, 11:21
- Re: ListDirData Event - wodDamir, 2010-12-22, 11:27
- Re: ListDirData Event - David Lucas, 2010-12-22, 11:21
- Re: ListDirData Event - David Lucas, 2010-12-22, 10:45
- Re: ListDirData Event - David Lucas, 2010-12-22, 10:35
- Re: ListDirData Event - David Lucas, 2010-12-22, 10:11
- Re: ListDirData Event - wodDamir, 2010-12-22, 09:55
- Re: ListDirData Event - David Lucas, 2010-12-22, 09:45
- Re: ListDirData Event - David Lucas, 2010-12-22, 09:43
- Re: ListDirData Event - woddrazen, 2010-12-21, 12:17