[CMake] Problem and proposed solution with cmake -E rename across devices

Clinton Stimpson clinton at elemtech.com
Wed Aug 31 17:12:06 EDT 2011


On Wednesday, August 31, 2011 10:30:22 am David Cole wrote:
> On Wed, Aug 31, 2011 at 11:49 AM, David Cole <david.cole at kitware.com> wrote:
> > The cmake -E rename command is documented to work only when src and
> > dst are on the same volume:
> > 
> > If you run "cmake -E" with no other args, the rename command is
> > documented as:
> > 
> >  rename oldname newname    - rename a file or directory (on one volume)
> > 
> > I think doing a copy as a fallback is a reasonable thing, but I think
> > it's on your side of the fence. CMake properly returns an error and
> > tells you "can't do that rename operation" and then it should be uo to
> > you to make a copy if that's what you want.
> > 
> > Others may want to do something else if rename cannot be done. I don't
> > think we should add code that says CMake will do a copy if rename
> > fails...
> > 
> > On Tue, Aug 30, 2011 at 3:21 PM, Clifford Yapp <cliffyapp at gmail.com> wrote:
> >> We've run into an issue with cmake -E rename where the rename fails
> >> due to rename() throwing EXDEV when done between devices (different
> >> partitions, nfs to local, etc).  Erik Greenwald has investigated and
> >> has proposed a fix to allow cmake -E rename to succeed across devices
> >> - if possible we'd like to get this or some related fix included,
> >> since this is a real-world build environment situation for us:
> >> 
> >> http://public.kitware.com/Bug/view.php?id=12433
> >> 
> >> Cheers, and thanks!
> >> 
> >> CY
> >> _______________________________________________
> >> Powered by www.kitware.com
> >> 
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >> 
> >> Please keep messages on-topic and check the CMake FAQ at:
> >> http://www.cmake.org/Wiki/CMake_FAQ
> >> 
> >> Follow this link to subscribe/unsubscribe:
> >> http://www.cmake.org/mailman/listinfo/cmake
> 
> Furthermore:
> 
> Additionally, "cmake -E rename" is supposed to be guaranteed to be
> "atomic" -- adding this code makes it "mostly atomic" and would negate
> the intent of some significant callers of rename...
> 
> Thx,
> David

What about adding something like "cmake -E move" which could be used to rename 
files but also support moving between devices?

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com


More information about the CMake mailing list