Reputation: 26966
I'm using csv.writer to write to file. Is it okay if the file is open in notepad at the same time?
What about programs other than notepad?
Upvotes: 0
Views: 563
Reputation: 12212
Notepad does not create explicit lock for open files.
http://en.wikipedia.org/wiki/File_locking
Upvotes: 3
Reputation: 5016
Notepad should be alright, as I do not believe it places a lock on the file. If it however is open in Microsoft Excel, a lock is placed on the file, so you cannot write to it.
Upvotes: 1
Reputation: 21368
As long as the application doesn't have a file lock on the file in question, then sure it's fine.
Having said that, if the user then edits the file in notepad after and saves it, it will stomp your edits. Most editors (i.e. Notepad++) will catch edited files and ask you whether or not you want to reload them, Notepad isn't one of them.
Upvotes: 1