[BUG?] WFX. FsRenMovFile. FS_FILE_EXISTS

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Maximus
Member
Member
Posts: 147
Joined: 2006-04-12, 10:51 UTC
Location: Ukraine
Contact:

[BUG?] WFX. FsRenMovFile. FS_FILE_EXISTS

Post by *Maximus »

Code: Select all

extern "C" __declspec(dllexport) int  __stdcall FsRenMovFile(char* OldName,char* NewName,bool Move,bool OverWrite,RemoteInfoStruct* ri)
{
    if(!strcmp(OldName,NewName)) return FS_FILE_OK;
    if(!OverWrite && ItemExists(NewName))
        return FS_FILE_EXISTS;
    CopyItem(OldName,NewName,Move,OverWrite);
    return FS_FILE_OK;
}
ItemExists - checks for existence
CopyItem - copy/move item
When I copy file from one folder to another (in WFX file system) and returns FS_FILE_EXISTS (if file exists) - all is ok - I get owerwrite dialog.
When I copy file to the same folder (by Shift+F5) and returns FS_FILE_EXISTS (if file exists) - all is ok - I get owerwrite dialog.
But when I rename file (by Shift+F6) and returns FS_FILE_EXISTS (if file exists) I have no owerwrite dialog. But I have this message:
---------------------------
Total Commander
---------------------------
Error: Cannot write \\\VFS\222.222!

Please remove the write protection!
---------------------------
ОК
---------------------------
This is right (I am very doubt)?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The plugin rename function doesn't currently support the overwriting of already existing files, therefore you currently get an error in this case.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9394
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:The plugin rename function doesn't currently support the overwriting of already existing files, therefore you currently get an error in this case.
This information is missing from the WFX documentation. Please add either the feature to TC or the information to the WFX interface documentation.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think in-place rename function should use same backend as normal rename.
User avatar
Dalai
Power Member
Power Member
Posts: 9394
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2MVV
What do you mean by "normal rename"?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, topic starter was talking about copy but it works with move too: open same FS folder in both panels and press F6 onto any file. You'll see copy/move dialog. And TC asks for overwriting when you type existing name.
User avatar
Dalai
Power Member
Power Member
Posts: 9394
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

So, by "normal rename" you mean regular move (F6); and in-place rename (Shift+F6) should behave like normal move. I second that.

I was surprised by TC's behavior as I thought "I don't have to worry about an overwrite confirmation dialog in FsRenMovFile since TC is using its own". Well, I was wrong. For now, I'm using my own overwrite confirmation dialog, but I'd rather see TC handling all that stuff.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply