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.Fclose

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.Fclose(file);

Description

Close a file open with the function lp.Fopen.

Parameters

file             A reference to a file (handle) obtained with lp.Fopen.

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.

 


www.loriotpro.com