Determining file size
white
Posts: 7
I want to write module, which write some diagnostic messages (like in notifications) from devices to NetLinx controller's file system.
I want to limit file size with some, but i don't know how to determine size of this file.
Yes, i can count number of char in for loops, but this is not good way.
Also, i want to know how many free space on controller.
Do you know how to do this?
I want to limit file size with some, but i don't know how to determine size of this file.
Yes, i can count number of char in for loops, but this is not good way.
Also, i want to know how many free space on controller.
Do you know how to do this?
0
Comments
When writing to my log file I do a FILE_OPEN and then I do a FILE_SEEK to the end of the file (-1 for Pos parameter.)
The return value of FILE_SEEK if positive = the byte size of the file.
If the new message length + the current file length is > my max size it’s time to start a new file.
HTH
Thanks.
This is my new module. It writes notifications to file. +