Checking file path before copying

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
Andre91
Junior Member
Junior Member
Posts: 5
Joined: 2018-01-03, 08:42 UTC

Checking file path before copying

Post by *Andre91 »

Hello

This is a bit of a longshot, but is anyone aware of a simple way (built in or addon) to restrict file copying based on target folder via TC.

Specifically what I need to do is disable copying from anywhere but a certain folder when the target folder has a certain name.

For example:

When target folder is like ...\IamRestricted\

then I want to only allow copying from certain folder(s).

Is there functionality like this in TC itself or one of the addons?
If not, how complicated would it be if I want to make that kind of an addon myself?

Regards,
A
Andre91
Junior Member
Junior Member
Posts: 5
Joined: 2018-01-03, 08:42 UTC

Post by *Andre91 »

Found info on windows CopyHookHandler, so if there is no simple way to do it
in TC, this is the option I will explore. Posting in case someone else needs this info.

However, the question for TC is still open.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Andre91,
Well, an ugly workaround would be to check the source and target directories using a script upon the copy dialog opening and based on the paths doing nothing or closing the dialog immediately. But it's ugly and not really guaranteed to work.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Andre91
Junior Member
Junior Member
Posts: 5
Joined: 2018-01-03, 08:42 UTC

Post by *Andre91 »

That script would be called by TC? Yes it's a bit ugly, in that case the CopyHook is nicer IMO. But for CopyHook I'd have to remember to add it when windows would reinstall and so on.
For TC I could just add the plugin to TC folder so i remember to install it with TC itself.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Andre91,
No, it would be running in the background, checking if the copy dialog appeared.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Andre91
Junior Member
Junior Member
Posts: 5
Joined: 2018-01-03, 08:42 UTC

Post by *Andre91 »

Ah that does sound a bit sketchy, especially if the dialog doesn't even show (small files?). Would prefer a safer solution.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Andre91 wrote:Ah that does sound a bit sketchy, especially if the dialog doesn't even show (small files?). Would prefer a safer solution.
I guess you will not find such a function in any file manager at all
and I know a lot of them.
Just make some Hotlist entries or buttons with Source and Target
for copying into that special dirs.
You may also generate predefined named Dir Sync settings if applicable.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Andre91,
The dialog always shows up, unless you drag and drop, but I agree it is not a really reliable workaround.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Andre91
Junior Member
Junior Member
Posts: 5
Joined: 2018-01-03, 08:42 UTC

Post by *Andre91 »

Horst.Epp wrote:
Andre91 wrote:Ah that does sound a bit sketchy, especially if the dialog doesn't even show (small files?). Would prefer a safer solution.
I guess you will not find such a function in any file manager at all
and I know a lot of them.
Just make some Hotlist entries or buttons with Source and Target
for copying into that special dirs.
You may also generate predefined named Dir Sync settings if applicable.
Well, seeing CopyHook MSDN description made me think something like it should already exist.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Andre91 wrote:
Horst.Epp wrote:
Andre91 wrote:Ah that does sound a bit sketchy, especially if the dialog doesn't even show (small files?). Would prefer a safer solution.
I guess you will not find such a function in any file manager at all
and I know a lot of them.
Just make some Hotlist entries or buttons with Source and Target
for copying into that special dirs.
You may also generate predefined named Dir Sync settings if applicable.
Well, seeing CopyHook MSDN description made me think something like it should already exist.
The Copy Hook is used by tools like FastCopy or TeraCopy
and this tools are not doing anything you want.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Post Reply