Talk:Working with files

From Spheriki

Jump to: navigation, search

What's flush() for?

"Yeah, we need to literally write the variable to the real file. So yeah, we flush it. With, of course, the flush() function."

WRONG. I always saved my files without using any flush() function in it, and files were saved just fine. So what the heck IS the flush() function for? --DaVince 14:45, 21 January 2007 (GMT)

File.flush() will write what's been buffered to the disk, without you having to close it first. File.close() will flush the file automatically before closing. It's like that with a lot of other languages/APIs as well. --Tunginobi 21:35, 21 January 2007 (GMT)
I just say I flush it for good measure. Just to be safe. --SteaxWiki 22:08 21 January 2007 (GMT)
Ah, okay. I'll be sure to flush (and close lol) my files in the future, then. --DaVince 07:51, 22 January 2007 (GMT)
Personal tools