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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'binary': 0.07; "'a'": 0.09; 'differently.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:files': 0.09; 'windows,': 0.09; 'python': 0.11; 'jan': 0.12; '"\\r\\n"': 0.16; "'b'": 0.16; "'r'": 0.16; "'rb')": 0.16; "'w'": 0.16; 'file).': 0.16; 'mode,': 0.16; 'newlines': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:program': 0.16; 'applies': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'platforms': 0.22; 'header:User-Agent:1': 0.23; 'specify': 0.24; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'mode': 0.30; 'sep': 0.31; 'universal': 0.31; 'text': 0.33; 'open': 0.33; 'convert': 0.35; 'subject:data': 0.36; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'ensure': 0.60; '2014,': 0.84; 'received:fios.verizon.net': 0.84; 'received:108': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: program to generate data helpful in finding duplicate large files
Date Mon, 22 Sep 2014 19:06:10 -0400
References <CALDD_==AYbQNPu29jRoLFp8WPZaZ9mMs79334-m_z3dgdxZRJw@mail.gmail.com> <CALvWhxvvtyH0Us8+9eg+JBcooUvq1kiTVqmfU0rg1XTtcJGmVg@mail.gmail.com> <1411414443.4182630.170466465.768582FE@webmail.messagingengine.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-108-16-203-145.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <1411414443.4182630.170466465.768582FE@webmail.messagingengine.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14238.1411427213.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1411427213 news.xs4all.nl 2954 [2001:888:2000:d::a6]:54563
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78186

Show key headers only | 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