Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78186

Re: program to generate data helpful in finding duplicate large files

From Terry Reedy <tjreedy@udel.edu>
Subject Re: program to generate data helpful in finding duplicate large files
Date 2014-09-22 19:06 -0400
References <CALDD_==AYbQNPu29jRoLFp8WPZaZ9mMs79334-m_z3dgdxZRJw@mail.gmail.com> <CALvWhxvvtyH0Us8+9eg+JBcooUvq1kiTVqmfU0rg1XTtcJGmVg@mail.gmail.com> <1411414443.4182630.170466465.768582FE@webmail.messagingengine.com>
Newsgroups comp.lang.python
Message-ID <mailman.14238.1411427213.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 9/22/2014 3:34 PM, random832@fastmail.us wrote:
> On Thu, Sep 18, 2014, at 14:45, Chris Kaynor wrote:
>> Additionally, you may want to specify binary mode by using
>> open(file_path,
>> 'rb') to ensure platform-independence ('r' uses Universal newlines, which
>> means on Windows, Python will convert "\r\n" to "\n" while reading the
>> file). Additionally, some platforms will treat binary files differently.
>
> Does 'r' not use universal newlines on unix?

'r' in the open mode means 'read', versus 'w' for 'write' and 'a' for 
'append'.  'b' means 'binary', versus 't' for 'text'.  I am pretty sure 
universal newlines only applies to text mode, as least in 3.x.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: program to generate data helpful in finding duplicate large files Terry Reedy <tjreedy@udel.edu> - 2014-09-22 19:06 -0400

csiph-web