Manage extended attributes in Swift
Add the following to Package.swift
:
.package(url: "https://github.com/sindresorhus/ExtendedAttributes", from: "1.1.0")
import ExtendedAttributes
let fileURL = URL(filePath: "/path/to/file")
let data = try? fileURL.extendedAttributes.get("com.example.attribute")
You can also use it to access system-specific metadata:
import ExtendedAttributes
let fileURL = URL(filePath: "/path/to/file")
let itemCreator = try? fileURL.systemMetadata.get(kMDItemCreator as String)
See the documentation.
- Defaults - Swifty and modern UserDefaults
- KeyboardShortcuts - Add user-customizable global keyboard shortcuts to your macOS app
- More…