{"id":47661952,"url":"https://github.com/causerp/physfs4cj","last_synced_at":"2026-04-06T12:01:32.716Z","repository":{"id":344836662,"uuid":"1170787816","full_name":"causerp/physfs4cj","owner":"causerp","description":"physfs4cj; a portable, flexible file i/o abstraction library","archived":false,"fork":false,"pushed_at":"2026-03-17T12:57:32.000Z","size":365,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T00:29:09.604Z","etag":null,"topics":["c","cangjie","cangjie-lang","cangjie-library","physfs","physfs-library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/causerp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-02T14:20:05.000Z","updated_at":"2026-03-17T12:57:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/causerp/physfs4cj","commit_stats":null,"previous_names":["causerp/physfs4cj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/causerp/physfs4cj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causerp%2Fphysfs4cj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causerp%2Fphysfs4cj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causerp%2Fphysfs4cj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causerp%2Fphysfs4cj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/causerp","download_url":"https://codeload.github.com/causerp/physfs4cj/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causerp%2Fphysfs4cj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31471466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["c","cangjie","cangjie-lang","cangjie-library","physfs","physfs-library"],"created_at":"2026-04-02T11:32:25.327Z","updated_at":"2026-04-06T12:01:32.710Z","avatar_url":"https://github.com/causerp.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# physfs4cj\n\nphysfs4cj is a Cangjie package that provides bindings for PhysicsFS, a portable,\nflexible file I/O abstraction library. It allows you to access files in a directory-independent\nway, making it ideal for games and applications that need to read assets from archives (ZIP, 7z, etc.)\nor specific platform directories.\n\n## Build Requirements\n\nTo build this package, you must have the following tools installed and available in your system's PATH:\n\n*   **C Compiler**: Clang or GCC\n*   **CMake**\n\nOnly zip and 7z archive formats are enabled. You can enable more archives by modifying `physfs/CMakePresets.json`.\n\n## How it Works\n\nThis library bundles a compiled static version of **PhysicsFS** directly within the package. \n\n*   **No External Dependencies**: You do not need to ship a separate `physfs.dll`, `libphysfs.so`,\n      or `physfs.dylib` with your application. The library self-contains the native code.\n*   **Native Cangjie FFI**: All functions from the C API are exposed as API calls in the resulting\n      dynamic library. This allows you to access low-level PhysFS functionality directly using Cangjie's\n      `foreign` keyword if the wrapped bindings don't cover your specific use case.\n\n## Examples\n\n### Initialize, Mount, and Read a File\n\nThis example demonstrates the typical lifecycle: initializing the library, mounting a directory\n(or archive), reading a file, and cleaning up.\n\n```\nimport physfs4cj.PhysFS\n\nmain() {\n    try {\n        // 1. Initialize the library\n        PhysFS.initialize()\n\n        // 2. Mount a directory (assumes \"test_data\" folder exists in cwd)\n        PhysFS.mount(\"test_data\", mountPoint: \"/\", appendToPath: true)\n        println(\"Mounted 'test_data' successfully.\")\n\n        // 3. Check if a file exists in the virtual path\n        if (PhysFS.exists(\"config.json\")) {\n            println(\"Found 'config.json' in the virtual file system.\")\n\n            // Get the real physical path (returns ?String)\n            let realPath = PhysFS.getRealDir(\"config.json\") ?? \"Unknown\"\n            println(\"Physical location: ${realPath}\")\n        } else {\n            println(\"'config.json' not found.\")\n        }\n\n        // Example of handling a non-existent file\n        let missingPath = PhysFS.getRealDir(\"missing.file\")\n        if (missingPath.isNone()) {\n            println(\"Correctly handled missing file (returned None).\")\n        }\n\n    } catch (e: Exception) {\n        println(\"PhysFS Error: ${e}\")\n    } finally {\n        // 4. Always deinitialize to clean up resources\n        PhysFS.deinitialize()\n    }\n}\n```\n\n## License\n\nzlib License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcauserp%2Fphysfs4cj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcauserp%2Fphysfs4cj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcauserp%2Fphysfs4cj/lists"}