os path, such as is.dir - can.write - path.appened
Currently works only on NIX (Linux, BSD, UNIX etc.) Maybe it will work on Mac since Mac is based on BSD, I have no way of testing. It will for sure not work on Windows currently. If you need it to work, let me know I can probably make that happen.
Module depands on nix commands test and realpath
There are tests for all commands. One test appears to fail even know the result is as expected. Still working on figuring that out; any help would be welcome.
This is my first Lua program/module, well right after Hello World.
Any suggestions are more then welcome.
filepath is.string All args in this module must be a string, if unsure check first with is.string
Append file or folder to path, adds seperator if needed
checks if filepath exists
filepath exists and is a filesytem directory/folder
alias for is.dir
filepath exists and is a filesytem file
filepath exists and is symbolic link
filepath exists and is a pipe
filepath exists and is socket
filepath exists and is character special
filepath exists and is block special
filepath exists and we can read the filepath
filepath exists and we can write to the filepath
filepath exists and we can run/execute the filepath
list all files and folders at given filepath
list all files at given filepath
list all files at given filepath by extention
list all folders at given filepath
Will return 3 items, works also on windows folder, filename, extention path.spilt("/tmp/test.lua.txt") -> /tmp/ test.lua.txt txt
returns filename including extention discarding folder/directory Returned value will be a filesystem file OR NIL
Returns the file extention from the given filepath if exists
returns absolute directory/folder path discarding filename. Returned value will be a filesystem directory/folder OR NIL
Print the resolved absolute file name; all but the last component must exist
realpath: [filepath]: No such file or directory ]]
First Created: 2022-06-19T03:43:44+03:00
Last Modified: 2026-04-05 19:35