Strange behavoir on copying files into plugin's filesystem

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
apowolozki
Junior Member
Junior Member
Posts: 7
Joined: 2010-07-06, 10:05 UTC
Location: Dortmund, Germany

Strange behavoir on copying files into plugin's filesystem

Post by *apowolozki »

Hello everybody,

i have implemented a small plugin which cares about my global assembly cache for dotnet assemblies.
The behavior on putting files into the cache (implemented via the FsPutFile method) is strange:
every time i'm tald that a file with given name and size of -1 exists and i'm asked if i want to overwrite existing file/skip/cancel/rename.
After it an ok/cancel dialog with title "error uploading file" appears, but my desired action is performed.

My implementation of the FsPutFile always returns FS_FILE_OK (0) value, that's why my question: why all the dialogs appear and how can i suppress them.

P.S.: I started my implementation with the samplefsplugin and there only changed needed methods and deleted not needed methods.

Thanks a lot in advance

Alexander
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Where do you return info that file exists and has size -1? If you don't want any confirmation dialogs just say that file doesn't exist always.
User avatar
apowolozki
Junior Member
Junior Member
Posts: 7
Joined: 2010-07-06, 10:05 UTC
Location: Dortmund, Germany

Post by *apowolozki »

MVV wrote:If you don't want any confirmation dialogs just say that file doesn't exist always.
I do not return any informations at any point as i have no such possibility.

what are possible points where such informations could be returned?

Alexander
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

AFAIK the only place where you can tell to TC that TC should display overwrite dialog - is to return FS_FILE_EXISTS in FsPutFile.

Maybe you can share your FsPutFile function for analyzing?
User avatar
apowolozki
Junior Member
Junior Member
Posts: 7
Joined: 2010-07-06, 10:05 UTC
Location: Dortmund, Germany

Post by *apowolozki »

MVV wrote:AFAIK the only place where you can tell to TC that TC should display overwrite dialog - is to return FS_FILE_EXISTS in FsPutFile.

Maybe you can share your FsPutFile function for analyzing?
Thanks a lot for your time spent for me, i just revised the code and have found the problem, it was my mistake.

The implementation of my FsPutFile method is qute simpe:

Code: Select all

int __stdcall FsPutFileW(WCHAR* LocalName,WCHAR* RemoteName,int CopyFlags)
{
	InstallAssembly(LocalName);
	return FS_FILE_OK;
}
where InstallAssembly is a method calling stuff from the fusion library.
The mistake was in a previos implementation of the library which was:

Code: Select all

int __stdcall FsPutFileW(WCHAR* LocalName,WCHAR* RemoteName,int CopyFlags)
{
	if(InstallAssembly(LocalName))
	{
		return FS_FILE_OK;
	}
	else
	{
		return FS_FILE_READERROR;
	}
}
but in this case i don't need to distinguish between the results.

P.S. if somebody is interested to get the plugin, i will publish it maybe in a week or so, after additional regression tests and cleaning the code.

Alexander
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Great that you've found the problem source! :)
Post Reply