Skip to content

lfs Module#

Filesystem helpers exposed by DCS.

Functions#


add_location#

Unknown.

lfs.add_location()

attributes#

Returns a table of file attributes.

attrs = lfs.attributes(path, attribute)
Parameter Type Required Description
path string Yes File or directory path.
attribute string Yes Attribute to query.
Return Type Description
attrs table File attributes, such as mode, modification, and size.

chdir#

Changes the current directory.

lfs.chdir(path)
Parameter Type Required Description
path string Yes Directory path.

create_lockfile#

Unknown.

lfs.create_lockfile()

currentdir#

Returns the install directory.

path = lfs.currentdir()
Return Type Description
path string Install directory.

del_location#

Unknown.

lfs.del_location()

dir#

Returns files and directories in the specified path.

entries = lfs.dir(path)
Parameter Type Required Description
path string Yes Directory path.
Return Type Description
entries table Files and directories in the path.

locations#

Returns available drives.

drives = lfs.locations()
Return Type Description
drives table Available drives.

md5sum#

Returns the MD5 hash of a file.

hash = lfs.md5sum(path)
Parameter Type Required Description
path string Yes File path.
Return Type Description
hash string MD5 hash.

mkdir#

Creates a directory.

lfs.mkdir(path)
Parameter Type Required Description
path string Yes Directory path.

normpath#

Returns the normalized path.

normalized = lfs.normpath(path)
Parameter Type Required Description
path string Yes Path to normalize.
Return Type Description
normalized string Normalized path.

realpath#

Returns the absolute path of a file.

absolute = lfs.realpath(path)
Parameter Type Required Description
path string Yes File path.
Return Type Description
absolute string Absolute path.

rmdir#

Removes a directory.

lfs.rmdir(path)
Parameter Type Required Description
path string Yes Directory path.

tempdir#

Returns the DCS temporary directory.

path = lfs.tempdir()
Return Type Description
path string Temporary directory, usually AppData\Local\Temp\DCS.

writedir#

Returns the Saved Games directory.

path = lfs.writedir()
Return Type Description
path string Saved Games directory path.