LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lp.CopyFile

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.

Syntax

value = lp.CopyFile('filename1','filename2');

Description

Copy the file filename1 in filename2

Parameters

'filename1'       The source file

'filename2'        The destination file

Return Values

value : value 1 if no error

Return nil if an error occurs

Example

- create a file yo test the lp.CopyFile function
fp=lp.Fopen('c:\\test.txt','wt');
if (fp) then
       lp.Fprintf(fp,'create file');
       lp.Fclose(fp);

       lp.CopyFile('c:/test.txt','c:/testback.txt');

       nb=lp.FindFile('c:','testback.txt','a');

       lp.Print(nb," find\n");
end

Warning  ! If you want to use the \ character in the path ypu should use the \\ instead. The \ character is use for escape sequence only in LUA.

copy file in LUA

 

 


www.loriotpro.com