xattr

Understanding output of xattr -p com.apple.quarantine

本秂侑毒 提交于 2020-02-20 10:55:51
问题 The other day I was messing with some files that had the extended attribute com.apple.quarantine on them. I am aware of its purpose, but I have always been curious what the properties below meant when you output its values. E.g. when I typed in xattr -p com.apple.quarantine xmlrpc.php for a file that has the said xattr, I get output like this: 0083;59b926ad;Safari.app;55847AA4-5562-42A2-89A7-8FAD394B455C What do the first 4 digits represent? i.e. 0083 Google hasn't brought up anything good

Understanding output of xattr -p com.apple.quarantine

给你一囗甜甜゛ 提交于 2020-02-20 10:54:39
问题 The other day I was messing with some files that had the extended attribute com.apple.quarantine on them. I am aware of its purpose, but I have always been curious what the properties below meant when you output its values. E.g. when I typed in xattr -p com.apple.quarantine xmlrpc.php for a file that has the said xattr, I get output like this: 0083;59b926ad;Safari.app;55847AA4-5562-42A2-89A7-8FAD394B455C What do the first 4 digits represent? i.e. 0083 Google hasn't brought up anything good

where are extended attributes stored?

两盒软妹~` 提交于 2020-01-01 09:31:51
问题 This is a simple question but I've done some research and can't find any answers... So does anyone know if when we define extended attributes through xattr, those attributes are stored within - as a part of - the file'contents(in the biggining, in the end?), or if the inode has a special region to store these? And by the way, i've read that in ext4 "each extended attribute is limited to a filesystem block (e.g. 4 KiB)". I can't tell if this is enough if I wanted to store 7 extended attributes

iOS how to store a NSDictionary or JSON in a file's xattr?

孤街醉人 提交于 2019-12-25 01:44:25
问题 I'm looking at extended file attributes for iOS and Mac files using setxattr command. From what I understand, I can store arbitrary data there, up to 128kb. How can I write and read extended attributes as if I'm dealing with a dictionary, not dereferencing string pointers? So far I have this code that attempts to set a single attribute. NSString* filepath = [MyValueObject filepath]; const char *systemPath = [filepath fileSystemRepresentation]; const char *name = "special_value"; const char

Printing string representations of xattr hex output

岁酱吖の 提交于 2019-12-22 11:27:19
问题 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

Using xattr to set the Mac OSX quarantine property

▼魔方 西西 提交于 2019-12-22 04:32:48
问题 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

Using multiple keywords in xattr via _kMDItemUserTags or kMDItemOMUserTags

时间秒杀一切 提交于 2019-12-20 09:45:53
问题 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-

Can you implement OS X's Finder download progress bars from a shell script?

青春壹個敷衍的年華 提交于 2019-12-13 01:29:35
问题 At first I thought this might be some variation on the extended attributes that can be modified with the xattr command line tool. However, I've staged several tests, and the files don't seem to have any special attributes while in this mode. Is this accessible at all from the command line, or is it only possible from within some cocoa api? 回答1: If you don't mind scripting with swift: #!/usr/bin/env swift import Foundation let path = ProcessInfo.processInfo.environment["HOME"]! + "/Downloads/a

'xattr' command not working inside sandbox app

核能气质少年 提交于 2019-12-12 20:08:34
问题 We were working on an IDE for a long time and it has com.apple.security.app-sandbox mode. User can download requisite SDK from internet (out of the box) and use in our IDE for development. Prior to use those SDK file we many time noticed files have quarantine attributes (com.apple.quarantine). Such files were forbidden to use inside a sandbox app in El Capitan due to it's tighter restriction policies. To overcome such blocker we decides to run a bash script prior to use those SDK files inside

How to use Extended File Attributes on NFS?

自闭症网瘾萝莉.ら 提交于 2019-12-09 17:43:03
问题 I have an NFS_Server - NFS_Client system. My client is mounted to an NFS_Server directory . I want to change the attribute of NFS_Server directory's files via NFS_Client mounted directory by using Extended File Attributes (xattr). When I tried to set an attribute from the client side, it gives the following answer: root@ubuntu:/mnt/nfs/var/nfs# setfattr -n user.comment -v "some comment" test.txt setfattr: nfs.txt: Permission denied My question is: is it possible to use Extended File