FSPlugin development
Moderators: Hacker, petermad, Stefan2, white
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
FSPlugin development
I try to create my first FS plugin.
Does any one know if it is possible to prevent the user to copy folders ? (I would like to authorize file copy only)
Does any one know if it is possible to prevent the user to copy folders ? (I would like to authorize file copy only)
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
I don't know much about the plugininterface - but if your plugin get a filename for each entry selected by the user, you could manually check the file in your plugin.
Actual implementation depends on language.. 
Code: Select all
callback function that responds to copy command(..)
{
FileDataType = openFile(..);
if(FileDataType->isDirectory())
{
//don't copy - perhaps warn the user ?
}
else
{
doStuff();
}
}

- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes you can! Implement the function FsStatusInfo. When it is called with FS_STATUS_START and FS_STATUS_OP_GET_MULTI, TC will start a download operation from your plugin. Now set a flag (e.g. incopy=TRUE), and if it is set, return 'no more files' when TC calls FsFindFirst! This prevents TC from listing subdirs during copy, and this way it cannot copy them. Don't forget to clear the flag on receiving FS_STATUS_END notification!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
Well, it works for the copy, but this method don't work for a FS_STATUS_OP_CALCSIZE.
I get an error (it seems to call findfirst many times then return an error)
I get an error (it seems to call findfirst many times then return an error)
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
- André Martin
- Senior Member
- Posts: 245
- Joined: 2003-02-05, 15:46 UTC
- Location: Dresden, Germany
Just handle FS_STATUS_OP_CALCSIZE in the same way as Christian it described it with the copy process (set a flag and when FNC is called return an invalid pointer and SetLastError to"no more files"...)
Browse the web with the HTTP SmartBrowserPlugin
Check your mails with the POP3/SMTP EmailPlugin!
Check your mails with the POP3/SMTP EmailPlugin!
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France