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


Groups > comp.lang.python > #29291

RE: Moving folders with content

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jyoung79@kc.rr.com>
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; 'exist,': 0.07; 'received:mail.rr.com': 0.07; 'cmd': 0.09; 'macos': 0.09; 'received:10.127': 0.09; 'received:75.180': 0.09; 'received:75.180.132': 0.09; 'received:cdptpa-omtalb.mail.rr.com': 0.09; '\'"\'': 0.16; 'subprocess': 0.16; 'bytes': 0.17; '>>>': 0.18; 'module': 0.19; 'import': 0.21; 'looks': 0.26; 'run': 0.28; 'maybe': 0.29; 'folder': 0.30; 'received:rr.com': 0.30; 'file': 0.32; 'like:': 0.33; 'to:addr:python-list': 0.33; 'direction': 0.35; 'something': 0.35; 'subject:with': 0.36; 'thank': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'copying': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'from:no real name:2**0': 0.60; 'subject:Moving': 0.84; 'subject:content': 0.84
Authentication-Results cdptpa-omtalb.mail.rr.com smtp.user=jyoung79@kc.rr.com; auth=pass (LOGIN)
X-Authority-Analysis v=2.0 cv=H+ZZMpki c=1 sm=0 a=05ChyHeVI94A:10 a=IkcTkHD0fZMA:10 a=ayC55rCoAAAA:8 a=AEITc67NsEEA:10 a=HSaJdv4jWVtbJpavjeQA:9 a=QEXdDO2ut3YA:10 a=Wm8N4nQisXyE0hqNaTxyMw==:117
X-Cloudmark-Score 0
Date Sun, 16 Sep 2012 8:02:09 +0000
From <jyoung79@kc.rr.com>
To python-list@python.org
Subject RE: Moving folders with content
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Priority 3 (Normal)
Sensitivity Normal
X-Originating-IP
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 <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.785.1347782537.27098.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347782537 news.xs4all.nl 6944 [2001:888:2000:d::a6]:51957
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:29291

Show key headers only | View raw


Thank you  "Nobody" and Hans!

> You may want to use the subprocess module to run 'ditto'.  If
> the destination folder does not exist, then ditto will copy MacOS
> specific aspects such as resource forks, ACLs and HFS meta-data.

This looks like a good direction to go.  Maybe something like:

>>> import os
>>> import subprocess
>>> 
>>> p1 = os.path.expanduser('~/Desktop/IN/Test/')
>>> p2 = os.path.expanduser('~/Desktop/OUT/Test/')
>>> 
>>> cmd = 'ditto -vV "' + p1 + '" "' + p2 + '"'
>>> 
>>> v = subprocess.check_output(cmd, shell=True)
>>> Copying /Users/jay/Desktop/IN/Test/ 
copying file ./.DS_Store ... 
6148 bytes for ./.DS_Store
copying file ./dude.txt ... 
4 bytes for ./dude.txt
copying file ./new.png ... 
114469 bytes for ./new.png

Jay

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


Thread

RE: Moving folders with content <jyoung79@kc.rr.com> - 2012-09-16 08:02 +0000
  Re: Moving folders with content Hans Mulder <hansmu@xs4all.nl> - 2012-09-16 12:40 +0200
    Re: Moving folders with content Nobody <nobody@nowhere.com> - 2012-09-16 15:31 +0100
      Re: Moving folders with content Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-16 14:53 -0400
      Re: Moving folders with content Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-16 16:53 -0400

csiph-web