AnsweredAssumed Answered

NAS LUA Script not retrieving all data for 'text_file_get'

Question asked by sdale on Jun 9, 2011
Latest reply on Jan 5, 2016 by jonhcw

I'm trying to write a LUA script to grab probe configuration files and dump them to a database table.  Problem is that when I call 'text_file_get' using LUA, it only returns a maximum of 4002 bytes no matter what I set the buffer to.  Has anyone been able to get more than 4002 bytes returned through LUA script?  FYI if I run the 'text_file_get' through the CTRL+P command utility it returns the entire config file.  Sample code is below.


                     local args2 = pds.create() 
                     pds.putString(args2, "directory", "probes/system/cdm") 
                     pds.putString(args2, "file", "cdm.cfg")                   
                     pds.putString(args2, "buffer_size", "100000")
                     local configfile, rc = nimbus.request(rinfo.addr, "text_file_get", args2)
                     if rc == 0 then                                           
                        local configtext = configfile.file_content
                        print (
                        configtext = configtext:gsub("'", "££")
                        configtext = configtext:gsub("\n", "¢¢")
                        myInsert =  "INSERT INTO " ..tabletobeused.." (hub,robot,probe,config) VALUES ('"..origin.."','"..hostname.."','cdm','"..configtext.."')"