I'm Trying to get file size I want to read (I want use dynamic allocation because I dont know how long CSV would be - so I have to know how many bytes I need). I tried to use FB_Tell (with FB_OPEN with MODEAPPEND attribute) but I get 0. I thought that cursor in append mode will be set at the end of file and I get the size. Documentation said that cursor will move after writing something and append gets 0. I tried to find something in BeckhoffInformationSystem, but there is no filesize functionblock or function. Is there any option to do this? Maybe I should get some information using ADS and communicate with WindowsCE system?
What you are looking for is FB_EnumFindFileEntry
Infosys
Given a proper path, it will return a structure of type ST_FindFileEntry
(Infosys) that contains, among other information, the file size in bytes