Go Back   FlashFXP Forums > >

Programming Need help with C/C++/Delphi? Ask here and make us all laugh.

Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 03-08-2005, 07:35 AM   #1
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default Dc_markdirty?

Can anyone tell me how this DC_MARKDIRTY works?
From DataCopy.h:
#define DC_DIRECTORY_MARKDIRTY 22 // Context = LPTSTR

So I can safely assume it uses shared memory or at least a DC_MESSAGE
typedef struct _DC_MESSAGE
{
HANDLE hEvent;
HANDLE hObject;
DWORD dwIdentifier;
DWORD dwReturn;
LPVOID lpMemoryBase;
LPVOID lpContext;
} DC_MESSAGE, * LPDC_MESSAGE;

Now I allocate soem shared mem in the usual way (works as expected) but how can I use this thing? I basically create a DC_MESSAGE in a free shmem block of size 1024 and lpContext pointing to directly after the DC_MESSAGE (like I do in SiteKill which works fine). Now I put a path in that piece (vpath/realpath I tried them all). But apparently there is nothing happening. io seems to keep its cache dirty.

Test:
login in to ioFTP
upload a file to dir TEST
go with explorer to that TEST dir and delete the uploaded file
refresh the dir for io or even logout and login and nothing gets properly updated. The .ioFTPD is still the same, io still things the file exists. Exchanging the .ioFTPD file also makes no difference.
So of some of the iniCom guys are reading this then please answer me this simple question... Prefreably in details. All I want to do is mark a directory as dirty and thus force io to recache it.
FTPServerTools is offline  
Old 03-08-2005, 08:24 AM   #2
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

Side note: The iniCom guys don't know how to do that. They are producers / distributors; not developers.

http://www.ioftpd.com/board/showthre...CTORYMARKDIRTY

http://www.ioftpd.com/board/showthre...=shared+memory

And:
Code:
void flushDirCache(const char *directory)
{
	if (!initSharedMem(1024 + ((DWORD)strlen(directory) + 1)))
		return;
	lpMessage->dwIdentifier	= DC_DIRECTORY_MARKDIRTY;
	LPTSTR folder = (LPTSTR)lpMessage->lpContext;
	CopyMemory(folder,directory,strlen(directory)+1);
	dwReturn = SendMessage(hIoFTPD, WM_SHMEM, NULL, (LPARAM)hMemory);
	if (!dwReturn) {
		WaitForSingleObject(hEvent,2000);
	}
	closeSharedMem();
}
Mouton is offline  
Old 03-08-2005, 09:50 AM   #3
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default

Thanks mouton I'll surely try that and make it into a tool (as usual)
And for the rest I was just teasing the iniCom guys. We know lots more about io then they do..
FTPServerTools is offline  
Closed Thread

Tags
dc_message, dir, file, test, upload

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:08 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)