size = FileLength(id)
id. The size returned by this function will be up to date with all operations done on this file. For example, you could write to the file and then
FileLength()would return the new size of the file.
Please note that
FileLength() can also return -1 if it does not know
the file's size. This can happen in case the file is read from a streamed
source through a file adapter, for example.
OpenFile(1, "test.txt", #MODE_WRITE) NPrint(FileLength(1)) WriteLine(1, "Hello World.") NPrint(FileLength(1)) CloseFile(1)The code above opens file "test.txt" for writing and calls
FileLength()twice. The first call will return 0 because the file is empty at that point but the second call will return 13 because some characters have been written to the file now.