fs(3lua): init man pages
Initialise man pages for the fs module.
This commit is contained in:
parent
2c6ad19111
commit
5cd636d6a7
17 changed files with 561 additions and 0 deletions
29
man/fs/fs.basename.3lua.scd
Normal file
29
man/fs/fs.basename.3lua.scd
Normal file
|
@ -0,0 +1,29 @@
|
|||
FS.BASENAME(3lua) "3lua" "Callisto manual pages"
|
||||
|
||||
# NAME
|
||||
*fs.basename* - get the last component of a path
|
||||
|
||||
# SYNOPSIS
|
||||
*fs.basename*(_path_: *string*)
|
||||
|
||||
# DESCRIPTION
|
||||
*fs.basename* returns the last component of _path_,
|
||||
removing any trailing slash "/" characters.
|
||||
If _path_ consists entirely of slash characters, the string "/" is
|
||||
returned.
|
||||
If _path_ is an empty string, the string "." is returned.
|
||||
|
||||
This is purely a string manipulation function
|
||||
and depends on no outside state.
|
||||
|
||||
# EXAMPLES
|
||||
Print the name of the currently running script file:
|
||||
|
||||
print("name of script file is " .. fs.basename(arg[0]))
|
||||
|
||||
Output example:
|
||||
|
||||
assert(fs.basename("/etc/fstab") == "fstab")
|
||||
|
||||
# SEE ALSO
|
||||
callisto(3lua), fs(3lua)
|
Loading…
Add table
Add a link
Reference in a new issue