exiftool -p $fileattributes "F:\file.jpg" gives this:
Warning: [Minor] Tag 'fileattributes' not defined - F:/file.jpg
It seems the following command must be used:
exiftool -q -q -api SystemTags -p $fileattributes "F:\file.jpg"
However, if the command contains an -if option that is true, -p $fileattributes displays as any normal print formatted tag, without using the -api or -q options
Is that a bug, or expected behaviour?
Maybe this behaviour has something to do with this thread:
https://exiftool.org/forum/index.php/topic,6849.0.html (https://exiftool.org/forum/index.php/topic,6849.0.html)
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>exiftool -ver
10.05
C:\Windows\system32>exiftool -p $fileattributes "F:\file.jpg"
Warning: [Minor] Tag 'fileattributes' not defined - F:/file.jpg
C:\Windows\system32>exiftool -api SystemTags -p $fileattributes "F:\file.jpg"
Regular; (none); Archive
Warning: PrintConv FileGroupID: The getgrgid function is unimplemented - F:/file.jpg
Warning: PrintConv FileUserID: The getpwuid function is unimplemented - F:/file.jpg
C:\Windows\system32>exiftool -q -q -api SystemTags -p $fileattributes "F:\file.jpg"
Regular; (none); Archive
C:\Windows\system32>exiftool -if "1==1" -p $fileattributes "F:\file.jpg"
Regular; (none); Archive
C:\Windows\system32>
Good point. I think this is an oversight (but I don't think related to the hidden file thread you referenced). I'll look into this and post back when I have a solution.
- Phil
I can't replicate the behaviour that you observe. I get this on my system (OS X):
> exiftool -p '$fileattributes' a.jpg
Regular; (none)
> exiftool -ver
10.05
What version of ExifTool are you using?
- Phil
Edit: Ah. I use a config file that sets the SystemTags option. This is why I didn't notice this problem before. I can now reproduce the problem. I'll fix this in the next release.
Edit2: Also, you are correct that it is the same problem as in the other thread (using FileAttributes in the -if argument).
Edit3: ExifTool 10.06 is now available
That's better, but -q -q is still required to avoid warnings.
Is that intended?
C:\Windows\system32>exiftool -ver
10.06
C:\Windows\system32>exiftool -p $fileattributes "F:\File.jpg"
Regular; (none); Archive
Warning: PrintConv FileGroupID: The getgrgid function is unimplemented - F:/File.jpg
Warning: PrintConv FileUserID: The getpwuid function is unimplemented - F:/File.jpg
C:\Windows\system32>exiftool -p $fileattributes "F:\File.jpg" -q -q
Regular; (none); Archive
Darn. That is annoying. :(
Try 10.07 (just released).
- Phil
Yep! Looks like you got it this time. Thank-you :)
C:\Windows\system32>exiftool -ver
10.07
C:\Windows\system32>exiftool -p $fileattributes "F:\1Hold\TEST\hidden attribute"
Regular; (none); Hidden, Archive
Regular; (none); Archive
1 directories scanned
2 image files read
C:\Windows\system32>exiftool -if "$fileattributes !~ /Hidden/" -p $fileattributes "F:\1Hold\TEST\hidden attribute"
Regular; (none); Archive
1 directories scanned
1 files failed condition
1 image files read
C:\Windows\system32>exiftool -if "$fileattributes =~ /Hidden/" -p $fileattributes "F:\1Hold\TEST\hidden attribute"
Regular; (none); Hidden, Archive
1 directories scanned
1 files failed condition
1 image files read