Documents

IO

io.attribute enumerations.

Syntax

io.attribute.archive
io.attribute.compressed
io.attribute.device
io.attribute.directory
io.attribute.encrypted
io.attribute.hidden
io.attribute.invalid
io.attribute.normal
io.attribute.offline
io.attribute.readonly
io.attribute.sparsefile
io.attribute.system
io.attribute.temporary
io.attribute.virtual
io.attributes

Retrieves file system attributes for a specified path.

Syntax

io.attributes(path)

attribute verification

// check if path is hidden
io.attribute.hidden(path)

// check if path is directory
io.attribute.directory(path)

var { atrr = io.attributes(path) }

// check if attr is hidden
io.attribute.hidden(atrr)

// check if attr is directory
io.attribute.directory(atrr)
io.copy

Copies an existing file to a new file.

Syntax

io.copy(pathFrom, pathTo)
io.copy(pathFrom, pathTo, options) options:
1 = skip_existing, 2 = overwrite_existing, 4 = update_existing, 16 = recursive
default = update_existing | recursive

Example:
io.copy('c:\old', 'd:\new', 16 | 4)
io.move

Moves an existing file or a directory, including its children..

Syntax

io.move(oldPath, newPath)
io.rename

Rename a file or directory.

Syntax

io.rename(oldName, newName)
io.delete

Deletes an existing path.

Syntax

io.delete(path)
io.directory.create (io.dir.create)

Create new directory.

Syntax

io.directory.create(path)
io.directory.exists (io.dir.exists)

Check if one or more directories exists.

Syntax

io.directory.exists(path)
io.directory.exists(path1, path2, path3, ...)
io.directory.empty (io.dir.empty)

Check if one or more directory is empty.

Syntax

io.directory.empty(path)
io.directory.empty(path1, path2, path3, ...)
File functions.
io.file.size

Retrieves the size of the specified file, in bytes.

Syntax

io.file.size(path)
io.file.exists

Check if one or more files exists.

Syntax

io.file.exists(path)
io.file.exists(path1, path2, path3, ...)
io.file.read

Read file contents as text with character count option.

Syntax

io.file.read(path)
io.file.read(path, 12)
io.file.create

Create new file with content option.

Syntax

io.file.create(path)
io.file.create(path, "Hello World!")
io.file.write

Writing to a file with new content.

Syntax

io.file.write(path, "Hello World!")
io.file.append

Appends text to an existing file, or to a new file if the specified file does not exist.

Syntax

io.file.append(path, "Hello ")
io.file.append(path, "World!")
io.datetime

Gets or Sets the time of the file.

Syntax

get date time io.datetime.created(sel.path)
io.datetime.modified(sel.path)
io.datetime.accessed(sel.path)

io.datetime.created(sel.path, 'y/m/d')
io.datetime.modified(sel.path, 'y/m/d')
io.datetime.accessed(sel.path, 'y/m/d')

set date time
io.datetime.created(sel.path,2000,1,1))
io.datetime.modified(sel.path,2000,1,1))
io.datetime.accessed(sel.path,2000,1,1))
io.meta

Gets meta data by property key.

Syntax

io.meta('path\to\file',"System.Size"))

This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub