{"id":20108954,"url":"https://github.com/alexanderschuetz97/luajlpath","last_synced_at":"2025-11-28T06:06:50.924Z","repository":{"id":57732305,"uuid":"475224790","full_name":"AlexanderSchuetz97/luajlpath","owner":"AlexanderSchuetz97","description":"Reimplementation/Port of the lua lpath library to luaj","archived":false,"fork":false,"pushed_at":"2022-03-29T00:35:46.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-13T05:29:21.653Z","etag":null,"topics":["library","lua","luaj","path"],"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-29T00:31:02.000Z","updated_at":"2022-03-29T00:40:30.000Z","dependencies_parsed_at":"2022-09-10T19:51:46.316Z","dependency_job_id":null,"html_url":"https://github.com/AlexanderSchuetz97/luajlpath","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%2Fluajlpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderSchuetz97%2Fluajlpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderSchuetz97%2Fluajlpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderSchuetz97%2Fluajlpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexanderSchuetz97","download_url":"https://codeload.github.com/AlexanderSchuetz97/luajlpath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549454,"owners_count":19980534,"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":["library","lua","luaj","path"],"created_at":"2024-11-13T18:06:26.141Z","updated_at":"2025-11-28T06:06:45.870Z","avatar_url":"https://github.com/AlexanderSchuetz97.png","language":"Java","readme":"# luajlpath\nluajlpath is a reimplementation/port of the lua lpath library for luaj.\n\nlpath is a lfs-like Lua module to handle path, file system and file information.\n\nFor more information on lpath see https://github.com/starwing/lpath\n\n## License\nluajlpath 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## Dependencies\n* Java 7 or newer\n* luaj version 3.0.1\n\n## Usage\nMaven:\n````\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.alexanderschuetz97\u003c/groupId\u003e\n    \u003cartifactId\u003eluajlpath\u003c/artifactId\u003e\n    \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n````\n\nIn Java:\n````\nGlobals globals = JsePlatform.standardGlobals();\nglobals.load(new LuajLPathLib());\n//.... (Standart LuaJ from this point)\nglobals.load(new InputStreamReader(new FileInputStream(\"test.lua\")), \"test.lua\").call();\n````\nIn test.lua:\n````\nlocal path = require(\"path\")\nprint(path(\"hello\", \"world\"))\nprint(path.cwd())\n````\n\n## Lua API\n\nmostly copied from https://github.com/starwing/lpath\n\n### `path`\n\n| routine                         | return value | description                                                  |\n| ------------------------------- | ------------ | ------------------------------------------------------------ |\n| `path(...)`                     | `string`     | return joined normalized path string.                        |\n| `path.ansi()`                   | `none`       | set path string encoding to local code page.                 |\n| `path.ansi(number)`             | `none`       | set the code page number for path string encoding.           |\n| `path.ansi(string)`             | `string`     | convert UTF-8 `string` to current code page encoding.        |\n| `path.utf8()`                   | `none`       | set path string encoding to UTF-8.                           |\n| `path.utf8(string)`             | `string`     | convert current code page encoding `string` to UTF-8.        |\n| `path.abs(...)`                 | `string`     | returns the absolute path for joined parts.                  |\n| `path.rel(path[, dir])`         | `string`     | returns  the relation path for dir (default for current work directory). |\n| `path.fnmatch(string, pattern)` | `boolean`    | returns whether the `pattern` matches the `string`.           |\n| `path.match(path, pattern)`     | `boolean`    | returns as `path.fnmatch`, but using Python path matching rules. |\n| `path.drive(...)`               | `string`     | returns  the drive part of path.                             |\n| `path.root(...)`                | `string`     | returns the root part of path. (`\\` on Windows, `/` or `//` on POSIX systems.) |\n| `path.anchor(...)`              | `string`     | same as `path.drive(...) .. path.root(...)`                  |\n| `path.parent(...)`              | `string`     | returns the parent path for path.                            |\n| `path.name(...)`                | `string`     | returns the file name part of the path.                      |\n| `path.stem(...)`                | `string`     | returns the file name part without suffix name of the path.  |\n| `path.suffix(...)`              | `string`     | returns  the suffix name of the path.                        |\n| `path.suffixes(...)`            | `iteraotr`   | returns  a `idx`, `suffix` iterator to get suffix names of the path. |\n| `path.parts(...)`               | `iterator`   | returns  a `idx`, `part` iterator to get parts in the path.  |\n| `path.exists(...)`              | `boolean`    | returns whether the path is exists in file system (same as `fs.exists()`) |\n| `path.resolve(...)`             | `string`     | returns the path itself, or the target path if path is a symlink. |\n| `path.cwd()`                    | `string`     | fetch the current working directory path.                    |\n| `path.bin()`                    | `string`     | fetch the current executable file path.                      |\n| `path.isdir(...)`               | `boolean`    | returns whether the path is a directory.                     |\n| `path.islink(...)`              | `boolean`    | returns whether the path is a symlink.                       |\n| `path.isfile(...)`              | `boolean`    | returns whether the path is a regular file.                  |\n| `path.ismount(...)`             | `boolean`    | returns whether the path is a mount point.                   |\n\n### `path.fs`\n\n| routine                               | return value | description                                                  |\n| ------------------------------------- | ------------ | ------------------------------------------------------------ |\n| `fs.dir(...)`                         | `iterator`   | returns a iterator `filename, type` to list all child items in path. |\n| `fs.scandir(...[, depth])`            | `iterator`   | same as `fs.dir`, but  walk into sub directories recursively. |\n| `fs.glob(...[, depth])`               | `iterator`   | same as `fs.scandir`, but accepts a pattern for filter the items in directory. |\n| `fs.chdir(...)`                       | `string`     | change current working directory and returns the path, or `nil` for error. |\n| `fs.mkdir(...)`                       | `string`     | create directory.                                            |\n| `fs.rmdir(...)`                       | `string`     | remove empty directory.                                      |\n| `fs.makedirs(...)`                    | `string`     | create directory recursively.                                |\n| `fs.remvoedirs(...)`                  | `string`     | remove all items in a directory recursively.                 |\n| `fs.unlockdirs(...)`                  | `string`     | add write permission for all files in a directory recursively. |\n| `fs.tmpdir(prefix)`                   | `string`     | create a tmpdir and returns it's path                        |\n| `fs.ctime(...)`                       | `integer`    | returns the creation time for the path.                      |\n| `fs.mtime(...)`                       | `integer`    | returns the modify time for the path.                        |\n| `fs.atime(...)`                       | `integer`    | returns the access time for the path.                        |\n| `fs.size(...)`                        | `integer`    | returns the file size for the path.                          |\n| `fs.touch(...[, atime[, mtime]])`     | `string`     | update the access/modify time for the path file, if file is not exists, create it. |\n| `fs.remove(...)`                      | `string`     | delete file.                                                 |\n| `fs.copy(source, target)`             | `boolean`    | copy file from the source path to the target path.           |\n| `fs.rename(source, target)`           | `boolean`    | move file from the source path to the target path.           |\n| `fs.symlink(source, target[, isdir])` | `boolean`    | create a symbolic link from the source path to the target path. |\n| `fs.exists(...)`                      | `boolean`    | same as `path.exists`                                        |\n| `fs.getcwd()`                         | `string`     | same as `path.cwd()`                                         |\n| `fs.binpath()`                        | `string`     | same as `path.bin()`                                         |\n| `fs.is{dir/link/file/mount}`          | `string`     | same as correspond routines in `path` module.                |\n\n### `path.env`\n\n| routine               | return value  | description                                                  |\n| --------------------- | ------------- | ------------------------------------------------------------ |\n| `env.get(key)`        | `string`      | fetch a environment variable value.                          |\n| `env.set(key, value)` | `string`      | set the environment variable value and returns the new value. |\n| `env.expand(...)`     | `string`      | return a path that all environment variables replaced.       |\n| `env.uname()`         | `string`, ... | returns the informations for the current operation system.   |\n\n### `path.info`\n\n`path.info` has several constants about current system:\n\n- `platform`:\n    - `\"windows\"`\n    - `\"linux\"`\n    - `\"posix\"`\n    - `\"macosx\"`-\u003e Not supported by luajlpath, it should appear as \"posix\".\n    - `\"android\"` -\u003e Not supported by luajlpath.\n- `sep`: separator of directory on current system. It's `\"\\\\\"` on Windows, `\"/\"` otherwise.\n- `altsep`: the alternative directory separator, always `\"/\"`.\n- `curdir`: the current directory, usually `\".\"`.\n- `pardir`: the parent directory, usually `\"..\"`.\n- `devnull`: the null device file, `\"nul\"` on Windows, `\"dev/null\"` otherwise\n- `extsep`: extension separator, usually `\".\"`.\n- `pathsep`: the separator for $PATH, `\";\"` on Windows, otherwise `\":\"`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderschuetz97%2Fluajlpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexanderschuetz97%2Fluajlpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderschuetz97%2Fluajlpath/lists"}