On Fri, 30 May 2014 13:13:07 -0400
Matthew Woehlke <mw_tr...@users.sourceforge.net> wrote:

> That was my assumption also. I would've thought that would be better,
> as coreutils basically exists only on Linux. (And even then, someone
> could in theory have a different 'cp', though that is unlikely.)
> 
> @Alessandro, would you expect this to ever be used on e.g. a BSD or
> OS/X system?

Well, in theory it's technically possible, in the sense that e.g. ZFS
should allow something like reflinks [1], however I'm not sure if
and when this will happen.
Moreover, currently there's no FS-independent syscall, there was a
proposal [2] but I can't see it implemented in the current Linux
kernel. This means that we have to deal directly with ioctl (see
actual `cp` implementation [3]), which is something specific per-FS (and
per-OS). Moreover we also have to detect the FS. It looks to me a lot
work to reinvent what `cp` is already doing, and will be doing in a
future-proof way.

I'd go for detecting if `cp` is from GNU coreutils and if it's recent
enough. If in future some other `cp` implements this we can detect it
as well, or if we get an easily usable syscall we can go for it.

What do you think?

--
Ale

[1] https://github.com/zfsonlinux/zfs/issues/405
[2] http://thread.gmane.org/gmane.linux.file-systems/31535
[3] http://bit.ly/1k9rWOd
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to