Page 1 of 1

Custom action vs exec script

Posted: 10 May 2019, 14:47
by devster
As --action now supports custom scripts with 2 parameters (as far as I could gather from the docs/code), does this imply that it can be used as an additional place for actions usually done by --exec?

For example, changing permissions, adding ACLs or converting links into absolute symlinks.

Is this appropriate or would exec still be better from a code perspective?

Re: Custom action vs exec script

Posted: 10 May 2019, 17:18
by rednoah
-exec is better suited for fixing permissions after files have been processed. If you're using your own --action then you can do absolutely anything, and so the FileBot history is disabled for these operations.

Notably, you can use + just like with find to run a single command with many file arguments, potentially making things much faster:

Code: Select all

-exec chmod 755 {f} +

Re: Custom action vs exec script

Posted: 10 May 2019, 18:44
by devster
Neat.
One of the main reasons was to use absolute symlinks, for some cases I find them very useful.

So if I may summarize the main differences between action and exec:
  • any custom action disables history, so it would need to be replicated in the action script if needed
  • actions do not have bindings available to exec (e.g. {n}, {t}, {f} and similar)
  • exec scripts support chaining arguments instead of running the command once for each file