File creation

Aaron Sterling dhaaron at
Sun Nov 25 01:00:55 CET 2001


    To create files, I am currently using:
        temp_file =, O_CREAT)
        open(file_name, 'w')

    Is this the cannonical way of doing it?  If so, would it be usefull to have a function, create_file(file_name, mode, bufsize), linked to the interpreter, that 
would create the file and return an associated file object? Is their a better way to do it, or is it something that shouldn't be done, and if so why?

Aaron, dhaaron at

More information about the Python-list mailing list