xattr

Printing string representations of xattr hex output

你离开我真会死。 提交于 2019-12-06 07:17:10
I'm trying to write a script to extract the original download URL from disk images downloaded with Safari on OS X using xattr, so that I can rename them but still easily obtain their original names for reference. This command prints the hex representation of the URL that the given file was downloaded from, as an example: xattr -p com.apple.metadata:kMDItemWhereFroms *.dmg gives 62 70 6C 69 73 74 30 30 A1 01 5F 10 4F 68 74 74 70 3A 2F 2F 61 64 63 64 6F 77 6E 6C 6F 61 64 2E 61 70 70 6C 65 2E 63 6F 6D 2F 4D 61 63 5F 4F 53 5F 58 2F 6D 61 63 5F 6F 73 5F 78 5F 31 30 2E 36 2E 31 5F 62 75 69 6C 64 5F

Using xattr to set the Mac OSX quarantine property

走远了吗. 提交于 2019-12-05 04:40:34
There is a lot of information on StackOverflow and elsewhere about how to clear the Mac quarantine property. In my case I would like to set it. This is in order to test that my app is properly signed so that the user will hot get the "Untrusted Developer" warning after downloading it. My app is particularly large (we distribute from a large file download site, not the store) and it is not convenient to have to upload and download to test this. I have had some battles with code signing the past week so this testing is important to me. Once a file has the quarantine property I see how I can

Using multiple keywords in xattr via _kMDItemUserTags or kMDItemOMUserTags

放肆的年华 提交于 2019-12-02 19:49:28
While reorganizing my images, in anticipation of OSX Mavericks I am writing a script to insert tags into the xattr fields of my image files, so I can search them with Spotlight. (I am also editing the EXIF just to be safe.) My questions are: Which attribute is the best to use? _kMDItemUserTags seems to be the OSX version, but kMDItemOMUserTags is already in use by OpenMeta. I would ideally like something that will be Linux and OSX forward compatible. How do I set multiple tags? Are the comma- or space-delimited or something else? As an example, using the python xattr module, I am issuing these

How to get extended attributes of a file(UNIX/C)?

浪尽此生 提交于 2019-12-01 11:07:46
When I type ls -l in the command line, sometimes an @ or + symbol comes up alongside the file permissions(btw, I am on OS X), as shown below: -rw-r-----@ 1 john staff 6731 Sep 28 01:10 mutations.txt drwxr-xr-x+ 71 john staff 2414 Mar 25 18:16 .. I know how to get the permission bits using the stat structure, but I don't think these extended permission values are there. Can someone point me in the right direction as to how to obtain these values via a C or POSIX API? EDIT : I attempted the following: #include <sys/types.h> #include <sys/xattr.h> #include <sys/types.h> int main () { char l[1024]

How to get extended attributes of a file(UNIX/C)?

泪湿孤枕 提交于 2019-12-01 06:16:16
问题 When I type ls -l in the command line, sometimes an @ or + symbol comes up alongside the file permissions(btw, I am on OS X), as shown below: -rw-r-----@ 1 john staff 6731 Sep 28 01:10 mutations.txt drwxr-xr-x+ 71 john staff 2414 Mar 25 18:16 .. I know how to get the permission bits using the stat structure, but I don't think these extended permission values are there. Can someone point me in the right direction as to how to obtain these values via a C or POSIX API? EDIT : I attempted the

What does the dot at the end of the permissions in the output of “ls -lah” mean?

丶灬走出姿态 提交于 2019-11-27 22:37:57
问题 I found some Linux files, and when I type ls -lah , it outputs this permissions format: ... drwxr-xr-x. 2 root root ... -rw-rw-r--. 1 root root ... I would like to know, what is the meaning of the dot ( -rw-rw-r--. ) at the end of the permissions format? 回答1: From info coreutils 'ls invocation' under Linux GNU `ls' uses a `.' character to indicate a file with an SELinux security context, but no other alternate access method. A file with any other combination of alternate access methods is