* added script for deleting xattr metadata

This commit is contained in:
Reinhard Pointner 2013-02-15 08:48:11 +00:00
parent 651e0dcc46
commit fa55b68360
2 changed files with 33 additions and 0 deletions

View File

@ -80,6 +80,26 @@ public class MetaAttributeView extends AbstractMap<String, String> {
}
@Override
public int size() {
try {
return attributeView.list().size();
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
@Override
public boolean isEmpty() {
try {
return attributeView.list().isEmpty();
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
private class AttributeEntry implements Entry<String, String> {
private final String name;

View File

@ -0,0 +1,13 @@
// filebot -script fn:xattr --action clear /path/to/files
args.getFiles{ it.xattr.size() > 0 }.each{
println it
it.xattr.each{ k, v ->
println "\t$k: $v"
}
// clear xattr mode
if (_args.action == 'clear') {
it.xattr.clear()
println '*** CLEARED ***'
}
}