Hello Phil,
Till now I used the following command to avoid that Exiftool does modify hidden files:
exiftool -api systemtags -if not "$fileattributes=~/Hidden/" -exampletag=examplevalue -ext jpg DIR
But this has some disadvantage for me, because it depends on used language ( e.g.: -lang de ) and it depends on option -n.
So I created an user-defined composite tag
IsHiddenReadonly => {
Require => 'FileAttributes', # needs also -api systemtags
ValueConv => q{
my @parts = split ' ', $val; # format of fileattributes is inta intb intc
# on windows intc: bit1=readonly bit2=hidden
my $sign = $parts[2];
$sign &= 3; # only these bits: hidden and readonly
return $sign;
},
},
and instead of the above given command I use the following
exiftool -api systemtags -if not "$fileattributes=~/23/" -exampletag=examplevalue -ext jpg DIR
The option -api systemtags is not moved into the config file, because I do not always work with hidden files.
Atleast on Windows it is working perfect for me.
Best regards
Herb
Hi Herb,
I don't understand this:
"$fileattributes=~/23/"
First, I thought you should be testing IsHiddenReadonly, not FileAttributes.
Second, the IsHiddenReadonlly value should never contain the string "23" because you have done "&= 3" to remove all bits but 0 and 1.
- Phil
Hello Phil,
yes you are right; the copy & past gremlin was here.
The command has to be
exiftool -api systemtags -if not "$IsHiddenReadonly=~/2|3/" -exampletag=examplevalue -ext jpg DIR
Hoping all is ok now
Best regards
Herb
Hi Herb,
Without the config file, I think this would do the same thing:
exiftool -api systemtags -if "not ($fileattributes#=~/^\S+ \S+ (\d+)$/ and $1 & 0x02)" -exampletag=examplevalue -ext jpg DIR
- Phil
Edit: Oops. "not" must be inside the quotes.