Copy a file like unix cp -a --reflink

P

Paulo da Silva

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
 
J

Jerry Hill

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.
 
A

Anssi Saari

Paulo da Silva said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top