Re: clarification on open file modes

2007-01-06 Thread Stefan Schwarzer
On 2007-01-05 03:46, tubby wrote: > Is this the safest, most portable way to open files on any platform: > > fp = open(file_name, 'rb') > fp.close() > > I understand that doing the following on Windows to a binary file (a > jpeg or exe files for example) can cause file corruption, is that correct?

Re: clarification on open file modes

2007-01-04 Thread Gabriel Genellina
At Thursday 4/1/2007 23:46, tubby wrote: I understand that doing the following on Windows to a binary file (a jpeg or exe files for example) can cause file corruption, is that correct? fp = open(file_name, 'r') fp.close() How can a simple open in read mode corrupt data??? You can't corrupt *

clarification on open file modes

2007-01-04 Thread tubby
Does a py script written to open and read binary files on Windows affect files on a Linux or Mac machine in a negative way? My concern is portability and safety. I want scripts written within Windows to work equally well on Linux and Mac computers. Is this the safest, most portable way to open