forked from DGNum/liminix
anoia: add basename, dirname
This commit is contained in:
parent
f4bf3029fa
commit
b231664a06
1 changed files with 8 additions and 0 deletions
|
@ -18,6 +18,12 @@
|
||||||
f (do (f:close) true)
|
f (do (f:close) true)
|
||||||
_ false))
|
_ false))
|
||||||
|
|
||||||
|
(fn basename [path]
|
||||||
|
(string.match path ".*/([^/]-)$"))
|
||||||
|
|
||||||
|
(fn dirname [path]
|
||||||
|
(string.match path "(.*)/[^/]-$"))
|
||||||
|
|
||||||
(fn system [s]
|
(fn system [s]
|
||||||
(match (os.execute s)
|
(match (os.execute s)
|
||||||
res (do (print (.. "Executed \"" s "\", exit code " (tostring res))) res)
|
res (do (print (.. "Executed \"" s "\", exit code " (tostring res))) res)
|
||||||
|
@ -69,6 +75,8 @@
|
||||||
{
|
{
|
||||||
: assoc
|
: assoc
|
||||||
: base64url
|
: base64url
|
||||||
|
: basename
|
||||||
|
: dirname
|
||||||
: dup
|
: dup
|
||||||
: file-exists?
|
: file-exists?
|
||||||
: hash
|
: hash
|
||||||
|
|
Loading…
Reference in a new issue