I am using Python.
What is the best way to open a file in rw if it exists, or if it does not, then create it and open it in rw? From what i read, file = open('myfile.dat', 'rw')
should do this, no? it is not working for me (python 2.6.2) and im wondering if it is a version problem, or not supposed to work like that or what.
The bottom line is, i just need a solution for the problem. I am curious about the other stuff, but all i need is a nice way to do the opening part.
UPDATE: the enclosing dir was writable by user and group, not other (im on a linux system... so permissions 775 in other words), and the exact error was IOError: no such file or directory.