Why no open(f, "w").write()?

Isaac To kkto at csis.hku.hk
Sun Jun 2 00:23:48 EDT 2002


>>>>> "John" == John La Rooy <larooy at xtar.co.nz> writes:

    John> Good point. If I had infinite memory and was allowed an infinite
    John> number of open files, I'd never need to close or flush my file
    John> objects, because the optimisation between my writing to a file and
    John> the actual event taking place will have no effect on the behaviour
    John> of my code. But it DOES have an effect doesn't it? Buffering is an
    John> optimisation, isn't it?

Is it remotely possible to make buffering to be transparent to the
programmer?  I don't think so: at least, when the language needs to define
the concurrency semantics: when two programs open the same file, when is it
guaranteed that the second program will correctly read the things written by
the first program.  It is not something that the programmer can say "okay,
I'll let the system to figure that out"... or do you have some new ideas
about it?

Regards,
Isaac.



More information about the Python-list mailing list