{"id":16948645,"url":"https://github.com/timoliver/tofileattributes","last_synced_at":"2025-04-11T20:12:41.072Z","repository":{"id":56923095,"uuid":"369213165","full_name":"TimOliver/TOFileAttributes","owner":"TimOliver","description":"A Realm-like dynamic property wrapper that maps to APFS extended file attributes.","archived":false,"fork":false,"pushed_at":"2021-06-20T07:02:04.000Z","size":510,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T20:12:33.025Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimOliver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-20T13:13:27.000Z","updated_at":"2021-06-21T04:28:44.000Z","dependencies_parsed_at":"2022-08-21T05:20:36.336Z","dependency_job_id":null,"html_url":"https://github.com/TimOliver/TOFileAttributes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FTOFileAttributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FTOFileAttributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FTOFileAttributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimOliver%2FTOFileAttributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimOliver","download_url":"https://codeload.github.com/TimOliver/TOFileAttributes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473126,"owners_count":21109628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T21:51:47.400Z","updated_at":"2025-04-11T20:12:41.049Z","avatar_url":"https://github.com/TimOliver.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TOFileAttributes\n![](screenshot.png)\n\n`TOFileAttributes` is an abstract class that can be extended to enable reading and writing custom data to a local file's [extended attributes](https://en.wikipedia.org/wiki/Extended_file_attributes). This allows quick and easy storage of transient information about a file (for example, the cursor position in a text file) in a non-destructive way that's invisible to the user.\n\nThe class is built upon the [`TOPropertyAccessor`](https://github.com/TimOliver/TOPropertyAccessor) library which provides a [Realm](https://github.com/realm/realm-cocoa)-like interface for defining custom model objects whose properties are mapped to an on-disk data store. This model makes it extremely easy and fast to set up new data schema, with all of the persistence logic handled under the hood.\n\n## Features\n\n* Properties defined in subclasses are directly mapped to attributes in a given file.\n* Instances are cached by default for easier re-use.\n* Properties are also cached internally in order to minimize the number of file reads and writes.\n* Certain properties can be marked as \"ignored\" and will function as normal.\n\n## Example\n\n```objc\n@interface FileAttributes : TOFileAttributes\n\n@property (nonatomic, assign) NSInteger cursorPosition;\n\n@end\n\n// Fetch an instance of the class wrapped around a specific file.\nFileAttributes *attributes = [FileAttributes attributesWithFileURL:URL];\n\n// Save the current cursor position to disk\nattributes.cursorPosition = 42;\n\n```\n\n## Requirements\n\n* iOS 11.0 or higher\n* Xcode 12.0 or higher\n\n## Installation Instructions\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eManual Installation\u003c/b\u003e\u003c/summary\u003e\n\u003cbr\u003e\n  \n1. Download the repositories for [`TOFileAttributes`](https://github.com/TimOliver/TOFileAttributes/archive/refs/heads/main.zip) and [`TOPropertyAccessor`](https://github.com/TimOliver/TOPropertyAccessor/archive/refs/heads/main.zip).\n2. Install the source files from the `TOFileAttributes` and `TOPropertyAccessor` folders.\n  \n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCocoaPods\u003c/b\u003e\u003c/summary\u003e\n\u003cbr\u003e\n  \nAdd `pod 'TOFileAttributes'` to your `Podfile`.\n  \n\u003c/details\u003e\n\n## Credits\n\n`TOFileAttributes` was written by [Tim Oliver](http://twitter.com/TimOliverAU) as a component of iComics 2.\n\n## License\n\n`TOFileAttributes` is licensed under the MIT license. Please check the [`LICENSE`](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoliver%2Ftofileattributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimoliver%2Ftofileattributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoliver%2Ftofileattributes/lists"}