File: lfs.luadoc

package info (click to toggle)
nmap 7.40-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 50,080 kB
  • ctags: 26,777
  • sloc: ansic: 98,862; cpp: 64,063; python: 17,751; sh: 14,584; xml: 11,448; makefile: 2,635; perl: 2,585; yacc: 660; lex: 457; asm: 372; java: 45; objc: 43
file content (48 lines) | stat: -rw-r--r-- 1,721 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-- The <code>lfs</code> module provides Nmap with a portable interface to file
-- system functions that are missing in the standard Lua libraries. The module
-- is a port of the LuaFileSystem module which was written as part of the
-- Kepler Project.
--

module "lfs"

--- Returns a directory iterator listing the contents of the given path
--
-- Each time the iterator is called with dir_obj it returns a directory entry's
-- name as a string, or nil if there are no more entries.
--
-- @param path string containing the directory to list
-- @return iterator function returning the next file or nil when done
-- @usage for f in lfs.dir("/tmp") do print("file:", f) end
function dir(path)

--- Creates a hard or symbolic link to a file
--
-- @param filepath string containing the object to link to
-- @param linkname string containing the name of the link
-- @param symbolic [optional] boolean true if link is symbolic
-- @return Status (true or false)
-- @return Error string (if status is false).
function link(filepath, linkname, symbolic)

--- Creates a new directory.
-- The parent directory has to exist otherwise the operation will fail
--
-- @param path string containing the directory name to create
-- @return Status (true or false)
-- @return Error string (if status is false).
function mkdir(path)

--- Removes an existing directory.
-- The directory has to be empty, otherwise the operation will fail
--
-- @param path string containing the directory name to remove
-- @return Status (true or false)
-- @return Error string (if status is false).
function rmdir(path)

--- Returns the OS specific directory path separator.
--
-- @return sep string containing the path separator
function get_path_separator()