Demo: Working with files | More Python for Beginners [15 of 20]

Play Demo: Working with files | More Python for Beginners [15 of 20]

The Discussion

  • User profile image
    feitosaneto
    The explanation of flush() I believe misses the important point...

    As a course for beginners, one will not understand a thing, because you did not mention the fact that the system will, at some time, write the contents to the disk by itself. Probably in the next second or less. The programmer does not need to do anything about it.

    flush() just syncs the contents of the file in disk, ensuring that all data written is on disk. You need to mention that the system uses buffers. A few slides ago you even showed the parameter but said no word about it. A buffers as an intermediate storage provided for each stream, in memory, to optimize disk access as a whole

Add Your 2 Cents