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


Groups > comp.lang.python > #22632

Re: Re: No os.copy()? Why not?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <driscoll@cs.wisc.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '(even': 0.05; 'memory.': 0.05; 'shutil': 0.07; 'portable': 0.09; 'suggestions.': 0.09; 'cc:addr:python-list': 0.10; 'subject:not': 0.11; '(unlike': 0.16; 'call)': 0.16; 'subject:Why': 0.16; 'basically': 0.17; 'wrote:': 0.19; 'least': 0.20; 'option.': 0.21; 'header:In-Reply-To:1': 0.22; "doesn't": 0.25; 'header:User-Agent:1': 0.26; 'fastest': 0.27; 'said,': 0.27; 'cc:addr:python.org': 0.28; 'cc:2**2': 0.32; 'could': 0.32; 'file': 0.33; 'pm,': 0.34; 'problems': 0.34; 'subject:?': 0.35; 'subject:: ': 0.37; 'most': 0.61; 'chance': 0.66; 'potentially': 0.78; 'idiomatic': 0.84; 'hardest': 0.91
Date Tue, 03 Apr 2012 15:21:25 -0500
From Evan Driscoll <driscoll@cs.wisc.edu>
User-Agent Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version 1.0
To Tycho Andersen <tycho@tycho.ws>
Subject Re: Re: No os.copy()? Why not?
References <38b3fc48-1d05-4373-b32e-64da95173864@pz2g2000pbc.googlegroups.com> <4F7B5397.8070405@druid.net> <20120403201032.GC2340@ccapuser-ubuntu.WICOURTS.GOV>
In-Reply-To <20120403201032.GC2340@ccapuser-ubuntu.WICOURTS.GOV>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Seen-By mailfromd 4.1 sandstone.cs.wisc.edu
Cc python-list@python.org, john_ladasky@sbcglobal.net
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1293.1333484492.3037.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1333484492 news.xs4all.nl 6919 [2001:888:2000:d::a6]:48980
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22632

Show key headers only | View raw


On 01/-10/-28163 01:59 PM, Tycho Andersen wrote:
> Note, though, that this reads the whole file into memory. As many
> others have said, shutil is the most idiomatic option.

* most idiomatic
* clearest in terms of showing intent
* potentially fastest
* hardest to screw up (unlike concatenating file names into a
   'system' call)
* has at least a snowball's chance of persisting metadata associated
   with the file (even if shutil doesn't now, it could theoretically
   change)
* portable

There's basically nothing NOT to like about shutil, and at least one 
significant problems with all the other suggestions.

Evan

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


Thread

No os.copy()?  Why not? John Ladasky <john_ladasky@sbcglobal.net> - 2012-03-28 13:12 -0700
  Re: No os.copy()? Why not? alex23 <wuwei23@gmail.com> - 2012-03-28 21:50 -0700
    Re: No os.copy()? Why not? John Ladasky <john_ladasky@sbcglobal.net> - 2012-03-30 02:25 -0700
  Re: No os.copy()? Why not? Ian Kelly <ian.g.kelly@gmail.com> - 2012-04-02 14:48 -0600
  Re: No os.copy()?  Why not? HoneyMonster <someone@someplace.invalid> - 2012-04-02 21:11 +0000
    Re: No os.copy()?  Why not? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-04-03 08:24 +0200
      Re: No os.copy()? Why not? John Ladasky <john_ladasky@sbcglobal.net> - 2012-04-03 02:34 -0700
        Re: No os.copy()? Why not? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-04-04 14:30 +0200
      Re: No os.copy()? Why not? Ian Kelly <ian.g.kelly@gmail.com> - 2012-04-03 10:29 -0600
  Re: No os.copy()?  Why not? D'Arcy Cain <darcy@druid.net> - 2012-04-03 15:46 -0400
    Re: No os.copy()?  Why not? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-04-04 05:53 +0000
      Re: No os.copy()? Why not? Chris Angelico <rosuav@gmail.com> - 2012-04-04 18:37 +1000
        Re: No os.copy()? Why not? Steve Howell <showell30@yahoo.com> - 2012-04-04 08:15 -0700
      Re: No os.copy()?  Why not? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-04-04 11:22 +0200
        Re: No os.copy()?  Why not? Roy Smith <roy@panix.com> - 2012-04-04 08:14 -0400
          Re: No os.copy()?  Why not? Nobody <nobody@nowhere.com> - 2012-04-04 20:37 +0100
      Re: No os.copy()?  Why not? Roy Smith <roy@panix.com> - 2012-04-04 08:08 -0400
        Re: No os.copy()? Why not? Chris Angelico <rosuav@gmail.com> - 2012-04-04 22:17 +1000
  Re: No os.copy()?  Why not? Tycho Andersen <tycho@tycho.ws> - 2012-04-03 15:10 -0500
  Re: Re: No os.copy()?  Why not? Evan Driscoll <driscoll@cs.wisc.edu> - 2012-04-03 15:21 -0500

csiph-web