On Feb 12, 2008 4:34 PM,  <Casper.Dik at sun.com> wrote:
> >Avinash Joshi wrote:
> >> I just wanted to know how to rename a directory.
> >> For moving the dir, there is a built in function ret =
> >> move_dir(pstruct->pw_dir, dir, logname); which is defined in
> >> usr/src/cmd/oamuser/user/movedir.c
> >>
> >> Is there a similar function that renames a directory?
> >
> >If the new name is on the same filesystem, see the rename(2) man page.
> And if not, cobble something together with posix_spawn and "mv(1)".

That would be better than the current

system("cd src && find . -print | cpio -m -pd dest");

(I'm the poor schmuck who filed this bug after having to wait 15
minutes for it to do this when a simple rename would have sufficed.)

As the comments in the bug say, though, any fix ought to handle
the zfs case properly as well.

-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/

Reply via email to