Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #62331 > unrolled thread
| Started by | Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> |
|---|---|
| First post | 2013-12-18 18:37 +0000 |
| Last post | 2013-12-20 21:17 +0200 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.lang.python
Copy a file like unix cp -a --reflink Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> - 2013-12-18 18:37 +0000
Re: Copy a file like unix cp -a --reflink Joel Goldstick <joel.goldstick@gmail.com> - 2013-12-18 14:19 -0500
Re: Copy a file like unix cp -a --reflink Jerry Hill <malaclypse2@gmail.com> - 2013-12-18 14:43 -0500
Re: Copy a file like unix cp -a --reflink Anssi Saari <as@sci.fi> - 2013-12-20 21:17 +0200
| From | Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> |
|---|---|
| Date | 2013-12-18 18:37 +0000 |
| Subject | Copy a file like unix cp -a --reflink |
| Message-ID | <l8sq0p$dd3$1@speranza.aioe.org> |
Hi! Is there a way to copy a file the same as Unix command: cp -a --reflink src dest without invoking a shell command? Thanks
[toc] | [next] | [standalone]
| From | Joel Goldstick <joel.goldstick@gmail.com> |
|---|---|
| Date | 2013-12-18 14:19 -0500 |
| Message-ID | <mailman.4376.1387394703.18130.python-list@python.org> |
| In reply to | #62331 |
[Multipart message — attachments visible in raw view] — view raw
On Wed, Dec 18, 2013 at 1:37 PM, Paulo da Silva < p_s_d_a_s_i_l_v_a@netcabo.pt> wrote: > Hi! > > Is there a way to copy a file the same as Unix command: > > cp -a --reflink src dest > > without invoking a shell command? > > Thanks > -- > https://mail.python.org/mailman/listinfo/python-list > You want to make a symlink to a file ini python. I think this might get you there: http://stackoverflow.com/questions/4847615/copying-a-symbolic-link-in-python -- Joel Goldstick http://joelgoldstick.com
[toc] | [prev] | [next] | [standalone]
| From | Jerry Hill <malaclypse2@gmail.com> |
|---|---|
| Date | 2013-12-18 14:43 -0500 |
| Message-ID | <mailman.4377.1387395802.18130.python-list@python.org> |
| In reply to | #62331 |
On Wed, Dec 18, 2013 at 1:37 PM, Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> wrote: > Hi! > > Is there a way to copy a file the same as Unix command: > > cp -a --reflink src dest > > without invoking a shell command? I started to dig through the cp man page to see what that did, then gave up when each option expanded out to several more. i.e., "-a, --archive same as -dR --preserve=all" leads to looking up -d -R and --preserve, etc. To me, it's just not worth it to spend more time researching your question than you spent writing the email asking it. If you don't get the answers you're looking for, you might try asking again, specifying the exact behavior you'd like to achieve. PS: That isn't really meant as any kind of complaint about your question. It's consise, easy to read, and gets right to the point. It just assumes a lot of background knowledge. If someone else happens to already know all of that background, they may be able to help right off. If not, they may be interested enough to do the research to figure it all out and then help. You just may be able to prompt more people to help by cutting down on the amount of work it would take them to do so. -- Jerry
[toc] | [prev] | [next] | [standalone]
| From | Anssi Saari <as@sci.fi> |
|---|---|
| Date | 2013-12-20 21:17 +0200 |
| Message-ID | <vg338lne3i7.fsf@coffee.modeemi.fi> |
| In reply to | #62331 |
Paulo da Silva <p_s_d_a_s_i_l_v_a@netcabo.pt> writes: > Hi! > > Is there a way to copy a file the same as Unix command: > > cp -a --reflink src dest > > without invoking a shell command? I vaguely remember this was asked and answered some time ago and the answer was no, even just for -a. In fact, the python shutil module documentation starts with a warning to that effect. The --reflink stuff would be another thing altogether. More accurately, currently the only way would be to duplicate this functionality of cp in python.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web