On Thu, Mar 06, 2008 at 11:10:58AM -0800, Alan M Wright wrote:
> Nicolas Williams wrote:
> >On Wed, Mar 05, 2008 at 06:09:15PM -0800, Alan M Wright wrote:
> >>So ... it would be unfortunate if the thing you wanted
> >>to rename was a directory.
> >
> >I'm not sure I follow.
> 
> Directories never have a link count of 1.

I am aware.

> > rename(2) can rename files and directories; so
> >can mv(1) (which uses rename(2)).  Directories cannot be hardlinked the
> >way files can be.
> 
> because the link count is used for another purpose.

Yes and no.  UFS does allow hardlinks to directories, and the OS allows
you to make those if you are sufficiently privileged.  Of course, one
should not want to.

Either way the link count has little to do with whether mv(1) could or
should allow you to change the preserved case of a name on a
case-insensitive filesystem.  If there's some way in which mv(1) looking
at the link count of the source/target could help it decide to let you
do what you asked for, then I've clearly missed it.

> >The fact that a work-around exists is nice -- this is a P4 or a P5.
> 
> Feel free to raise the RFE but (my opinion) I don't think changing
> mv(1) to allow this by default is a good idea.  What do you do on
> mixed-mode file systems, would mv(1) take the case-sensitive or the
> case-insensitive perpspective?  Even if you add a new flag, you
> would still have caveats - perhaps better to create a new command.

I said nothing about "by default."  mv(1) needs to retain its current
semantics on case-sensitive filesystems.

A new rename(1) command that maps to a straight rename(2) call, just
like link(1M) maps to a straightforwardly to a call to link(2), is
probably a very good idea anyways, since it will be much simpler than
mv(1) as it won't be burdened with all of mv(1)'s semantics.

I've filed:

6672302 rename(1) equiv to rename(2), like link(1M) is to link(2), is needed

Nico
-- 
_______________________________________________
storage-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/storage-discuss

Reply via email to