Function: ext.PutFile

Writes the given data to a file in the Extension’s data folder (e.g. ‘data/mod/demopanel’) or custom folder (if set). If the file doesn’t exist, it is created. If the file exists, its content is replaced by the given data. If the path contains non-existing folders (e.g. ‘mypath ewfolder est.txt’), the missing folders are created automatically. It is not possible to overwrite the Module’s LNG files or any of its Module/App/Legacy/Config XML files. Returns true if the file was written successfully, otherwise false.

Syntax

{
	"method": "ext.PutFile",
	"params": {
		"path": "...",
		"data": "...",
	},
	"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
}
AdvFuture<bool> PutFile( AdvString path, std::vector<uint8_t> data );
public Task<bool> PutFileAsync(string path, byte[] data, CancellationToken ct = default);
putFile(path: string, data: string): Promise<boolean>;

Parameters

path : string

Name of the file to be written to. Can be a relative path to the Extension’s data folder or custom folder (if set). Example: ’test.txt’ or ‘mypath\test.txt’

data : data

The complete file content.

Result : bool