Checking file path before copying

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

Moderators: sheep, Hacker, Stefan2, white

Post Reply
Andre91
Junior Member
Junior Member
Posts: 5
Joined: 2018-01-03, 08:42 UTC

Checking file path before copying

Post by *Andre91 » 2018-01-03, 08:53 UTC

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 » 2018-01-03, 09:20 UTC

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: 11360
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker » 2018-01-03, 10:45 UTC

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 » 2018-01-03, 11:21 UTC

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: 11360
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker » 2018-01-03, 12:23 UTC

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 » 2018-01-03, 12:45 UTC

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: 3445
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp » 2018-01-03, 13:35 UTC

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 10 Home x64 November 2019 Update, Version 1909 (OS Build 18363.476)
Intel(R) Core(TM) i7-4770 CPU @ 3.40GH, 16GB RAM
TC 9.50ß6 x64 / x86, Everything 1.4.1.956 (x64)

User avatar
Hacker
Moderator
Moderator
Posts: 11360
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker » 2018-01-03, 14:10 UTC

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 » 2018-01-03, 15:40 UTC

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: 3445
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp » 2018-01-03, 16:17 UTC

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 10 Home x64 November 2019 Update, Version 1909 (OS Build 18363.476)
Intel(R) Core(TM) i7-4770 CPU @ 3.40GH, 16GB RAM
TC 9.50ß6 x64 / x86, Everything 1.4.1.956 (x64)

Post Reply