Skip to content

LUA API v2 Legacy Files

Aranaktu edited this page Aug 10, 2026 · 2 revisions

LEGACY FILES

Provides access to the legacy files.

Functions

List of functions for managing legacy files

LegacyFileExist

Check if legacy file exist

Declaration

bool LegacyFileExist(string fpath)

Parameters

Type Name Description
string fpath file path

Returns

Retruns true if legacy file exist

Example

local fpath = "data/db/fifa_ng_db.db"
if LegacyFileExist(fpath) then
    -- Export on Desktop if file exist
    if LegacyFileExport(fpath) then
        print(string.format("File %s exported on Desktop", fpath))
    else
        print(string.format("File %s export failed", fpath))
    end
else
    print(string.format("File %s not exist", fpath))
end

LegacyFileExport

Export legacy file

Declaration

bool LegacyFileExport(string fpath, string outpath)

Parameters

Type Name Description
string fpath file path
string outpath (optional) Location where exported file should be saved. If not provided file will be exported on Desktop

Returns

Retruns true if legacy file exported successfully

Example

local fpath = "data/db/fifa_ng_db.db"
if LegacyFileExist(fpath) then
    -- Export on Desktop if file exist
    if LegacyFileExport(fpath) then
        print(string.format("File %s exported on Desktop", fpath))
    else
        print(string.format("File %s export failed", fpath))
    end
else
    print(string.format("File %s not exist", fpath))
end

Clone this wiki locally