[WFX] When does TC call FsRemoveDir?

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
CoolWater
Power Member
Power Member
Posts: 744
Joined: 2003-03-27, 16:33 UTC

[WFX] When does TC call FsRemoveDir?

Post by *CoolWater »

Although an entry was defined as FILE_ATTRIBUTE_DIRECTORY (folder icon is shown), TC never calls FsRemoveDir? So when does TC call this function?

What I also observed is, that TC allows removing a file using DEL key (but the entry still remains in the list) although FsDeleteFile is not exported. Is this intentional or am I doing something wrong?

Regards,
CoolWater
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

FsDeleteFile() must be an exported function, too.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
CoolWater
Power Member
Power Member
Posts: 744
Joined: 2003-03-27, 16:33 UTC

Post by *CoolWater »

tbeu wrote:FsDeleteFile() must be an exported function, too.
If I want to use it, I surely must export it. But dont't want to use it!
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

CoolWater wrote:But dont't want to use it!

Code: Select all

BOOL __stdcall FsDeleteFile(char* RemoteName){return FALSE;}
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
CoolWater
Power Member
Power Member
Posts: 744
Joined: 2003-03-27, 16:33 UTC

Post by *CoolWater »

Nope... Then TC refreshes the file list after it displayed an error message since the file could not be deleted! If this function is not exported, TC should not allow/not react to DEL key or delete button.

This function is not mandatory and needs not to be exported if not supported!
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

Maybe I am wrong. However this is what I did to make FsRemoveDir() be called by TC.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed FsRemoveDir will only be called when FsDeleteFile is present too. Why? The function used for deleting is a combined function which goes through the list of selected directories and files, and then deletes them.

Why not just return true to FsDeleteFile without deleting anything? No error will be shown, and the (pseudo?) file will remain in the list.
Author of Total Commander
https://www.ghisler.com
Post Reply