{"id":21944974,"url":"https://github.com/alexanderschuetz97/luajfshook","last_synced_at":"2026-05-13T23:34:51.904Z","repository":{"id":57732302,"uuid":"473836901","full_name":"AlexanderSchuetz97/LuajFSHook","owner":"AlexanderSchuetz97","description":"Hook for Luaj's JseIoLib and other file related functions for more control over how luaj interacts with the file system","archived":false,"fork":false,"pushed_at":"2022-03-25T02:46:53.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-03T17:47:04.947Z","etag":null,"topics":["java","library","lua","luaj"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexanderSchuetz97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-25T02:05:45.000Z","updated_at":"2022-03-25T02:47:52.000Z","dependencies_parsed_at":"2022-09-10T19:51:50.832Z","dependency_job_id":null,"html_url":"https://github.com/AlexanderSchuetz97/LuajFSHook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderSchuetz97%2FLuajFSHook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderSchuetz97%2FLuajFSHook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderSchuetz97%2FLuajFSHook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderSchuetz97%2FLuajFSHook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexanderSchuetz97","download_url":"https://codeload.github.com/AlexanderSchuetz97/LuajFSHook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244982058,"owners_count":20542300,"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":["java","library","lua","luaj"],"created_at":"2024-11-29T04:17:31.370Z","updated_at":"2025-10-17T04:28:57.797Z","avatar_url":"https://github.com/AlexanderSchuetz97.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LuajFSHook\nHook for Luaj's JseIoLib and other file related functions for more control over how luaj interacts with the file system.\n\u003cbr\u003eLuajFSHook provides an API that can be used to \n1. Improve interoperability between lua libraries that use the file system\n2. To more easily Sanbox/Jail Luaj's IO lib without having to reimplement the IO Library\n3. Implement a virtual file system to be used by lua that is completely unrelated to the real filesystem.\n\n## License\nLuajFSHook is released under the GNU Lesser General Public License Version 3. \u003cbr\u003e\nA copy of the GNU Lesser General Public License Version 3 can be found in the COPYING \u0026 COPYING.LESSER files.\u003cbr\u003e\n\n## Requirements\n* Java 7 or newer\n* LuaJ 3.0.1\n\n## Usage:\nMaven:\n````\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.alexanderschuetz97\u003c/groupId\u003e\n  \u003cartifactId\u003eluajfshook\u003c/artifactId\u003e\n  \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n````\n\nIn Java:\n````\nGlobals globals = JsePlatform.standardGlobals();\n//This will overwrite Globals.finder!\nLuajFSHook.install(globals);\n//This may be used by your library\nLuaFileSystemHandler handler = LuajFSHook.get(globals);\n\n//Example: Lua has a different workdir compared to the jvm\n\n//First we create the \"subfolder\" which will serve as our new work dir.\nnew File(new File(\".\"), \"luaworkdir\").mkdir();\n\n//We get the current work dir that lua uses. This will be equal to \".\"\nLuaPath workDir = handler.getWorkDir().child(\"luaworkdir\");\n//Now we change the work dir for lua to the folder we made earlier\nhandler.setWorkDirectory(workDir.child(\"luaworkdir\"));\n\n//Now we run our lua script the provided example will just create a file.\nglobals.load(new InputStreamReader(new FileInputStream(\"test.lua\")), \"test.lua\").call();\n//The lua script should have created the file \"./luaworkdir/test.txt\" \n````\nIn test.lua:\n````\nlocal io = require('io')\nlocal file = io.open(\"test.txt\", \"w+\")\nfile:write(\"Hello World\")\nfile:close()\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderschuetz97%2Fluajfshook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexanderschuetz97%2Fluajfshook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderschuetz97%2Fluajfshook/lists"}