its the easiers way.. to leave it open
Sure, but it's not the right way.
So your advice open file write data and close it .. next 5 min open it again etc.. OK ., so window for crashing file is very small(only during writing)
Yes, it is.
But will the program or file know where the put the next line, is the pointer where the last character is written alway known, when i open the file again?
Depends on how you open the file. If you open in append mode, then, yes, the write pointer is positioned at the end of the file.
So a flush will save it directly , what will do en close instruction , save an EOF???
Each time you call the write() (or print() or println()) method, data is written to a buffer. The flush() method actually causes a write to the file, copying the buffer contents into the file. The close() method calls flush(). Closing the file does write an EOF into the file, while flush() does not.