This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

memory size for files created by script
#1
Hi all,


I would like to know the maximum memory size available if I want to create files with the Lua functions "io.open/write".

Then, in what default directory will these files be created, and how can I specify another one?


Thank's in advance fior your help.
Reply
#2
Please explain what are you trying to do and what kind of data do you want to write into these files.
Reply
#3
I want to save, in a simple way, in a file, (without sql for example) the variations of values ​​of objects of type "string".
Reply
#4
What is the purpose of this, what do you want to do with this file?
Reply
#5
to use it as a log file I can link to an e-mail for example.
Reply
#6
Why don't you use storage?
------------------------------
Ctrl+F5
Reply
#7
because i have a lot of small strings to record :
12 shorts strings even 10 seconds, during 30 days...
Reply
#8
If each string is 20 bytes long then your whole log will be at least 60MB in size. Most probably you won't be able to send that using e-mail.
As for writing into files you should not write to SD card often as it can quickly kill it. One solution is to write to a temporary file then move it to SD by the end of the day by using a scheduled script. There's a slight disadvantage that this file can be lost if the device is rebooted. You should also take care of deleting old log files.
Reply
#9
Ok, thanks for the reply on the file size: I will therefore only send the useful records by e-mail (error reports in my case), after the complete file.

The SD card you are talking about is internal to the LM?

If yes :
I was just thinking of using a USB key to save the log file, to avoid using too much internal memory.
Do you have an example script that copies a file to an USB key (I don't know this point on LM)?
Reply
#10
Yes, LM uses a microSD card internally. As for USB, have a look at this: https://forum.logicmachine.net/showthread.php?tid=678
Reply
#11
ok, many thank's, I will try this.

Do you think it would be better for me to use an SQL database for recording my data?
Reply
#12
Depends on what kind of data you want to record. "shorts strings" does not say much.
Reply


Forum Jump: