Re: safest way to open files on all platforms

2005-02-14 Thread Fredrik Lundh
"rbt" wrote: > I'm using 'rb' in a situation where all files on the drive are opened. I'm > not checking how the > file is encoded before opening it (text, unicode, jpeg, etc.) That's why I > though 'rb' would be > safest. if "safest way to open files" meant "safest way to open binary files",

Re: safest way to open files on all platforms

2005-02-14 Thread rbt
Fredrik Lundh wrote: "rbt" wrote: I believe that this is the safest way to open files on Windows, Linux, Mac and Unix, but I wanted to ask here just to be sure: fp = file('filename', 'rb') The 'b' on the end being the most important ingredient (especially on Windows as a simple 'r' on a binary

Re: safest way to open files on all platforms

2005-02-14 Thread Fredrik Lundh
"rbt" wrote: >I believe that this is the safest way to open files on Windows, Linux, Mac and >Unix, but I wanted >to ask here just to be sure: > > fp = file('filename', 'rb') > > The 'b' on the end being the most important ingredient (especially on Windows > as a simple 'r' on a > binary file

safest way to open files on all platforms

2005-02-14 Thread rbt
I believe that this is the safest way to open files on Windows, Linux, Mac and Unix, but I wanted to ask here just to be sure: fp = file('filename', 'rb') The 'b' on the end being the most important ingredient (especially on Windows as a simple 'r' on a binary file might cause some sort of corr