{"id":13534434,"url":"https://github.com/ziglibs/known-folders","last_synced_at":"2025-05-16T13:06:01.207Z","repository":{"id":45322378,"uuid":"265070539","full_name":"ziglibs/known-folders","owner":"ziglibs","description":"Provides access to well-known folders across several operating systems","archived":false,"fork":false,"pushed_at":"2025-03-01T12:19:12.000Z","size":99,"stargazers_count":258,"open_issues_count":3,"forks_count":23,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T09:19:56.490Z","etag":null,"topics":["zig","zig-library","zig-package"],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/ziglibs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-18T21:48:43.000Z","updated_at":"2025-04-05T09:59:49.000Z","dependencies_parsed_at":"2023-11-17T00:06:31.952Z","dependency_job_id":"570428cd-9451-4b87-856e-1dbae38f2b4e","html_url":"https://github.com/ziglibs/known-folders","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Fknown-folders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Fknown-folders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Fknown-folders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglibs%2Fknown-folders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziglibs","download_url":"https://codeload.github.com/ziglibs/known-folders/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543884,"owners_count":21121849,"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":["zig","zig-library","zig-package"],"created_at":"2024-08-01T07:01:32.949Z","updated_at":"2025-04-12T09:20:02.486Z","avatar_url":"https://github.com/ziglibs.png","language":"Zig","readme":"# Zig Known Folders Project\n\n## Design Goals\n\n- Minimal API surface\n- Provide the user with an option to either obtain a directory handle or a path name\n- Keep to folders that are available on all operating systems\n\n## API\n\n```zig\npub const KnownFolder = enum {\n    home,\n    documents,\n    pictures,\n    music,\n    videos,\n    desktop,\n    downloads,\n    public,\n    fonts,\n    app_menu,\n    cache,\n    roaming_configuration,\n    local_configuration,\n    global_configuration,\n    data,\n    runtime,\n    executable_dir,\n};\n\npub const Error = error{ ParseError, OutOfMemory };\n\npub const KnownFolderConfig = struct {\n    xdg_force_default: bool = false,\n    xdg_on_mac: bool = false,\n};\n\n/// Returns a directory handle, or, if the folder does not exist, `null`.\npub fn open(allocator: std.mem.Allocator, folder: KnownFolder, args: std.fs.Dir.OpenOptions) (std.fs.Dir.OpenError || Error)!?std.fs.Dir;\n\n/// Returns the path to the folder or, if the folder does not exist, `null`.\npub fn getPath(allocator: std.mem.Allocator, folder: KnownFolder) Error!?[]const u8;\n```\n\n## Installation\n\n\u003e [!NOTE]\n\u003e The minimum supported Zig version is `0.14.0-dev.3445+6c3cbb0c8`.\n\nInitialize a `zig build` project if you haven't already.\n\n```bash\nzig init\n```\n\nAdd the `known_folders` package to your `build.zig.zon`.\n\n```bash\nzig fetch --save git+https://github.com/ziglibs/known-folders.git\n```\n\nYou can then import `known-folders` in your `build.zig` with:\n\n```zig\nconst known_folders = b.dependency(\"known_folders\", .{}).module(\"known-folders\");\nconst exe = b.addExecutable(...);\n// This adds the known-folders module to the executable which can then be imported with `@import(\"known-folders\")`\nexe.root_module.addImport(\"known-folders\", known_folders);\n```\n\n## Configuration\n\nIn your root file, add something like this to configure known-folders:\n\n```zig\npub const known_folders_config = .{\n    .xdg_on_mac = true,\n}\n```\n","funding_links":[],"categories":["Misc libraries","Libraries","Zig","Language Essentials"],"sub_categories":["Zig","File Format Processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziglibs%2Fknown-folders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziglibs%2Fknown-folders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziglibs%2Fknown-folders/lists"}