Which one is correct mv or Path#move?

Rajendra Gutupalli Rajendra.Gutupalli at Sun.COM
Thu Jul 31 04:51:41 PDT 2008

Alan Bateman wrote:
> Rajendra Gutupalli wrote:
>> Hi Alan,
>> I see difference in behavior between command mv and Path.move(). I 
>> created and moved a hardlink to a assigned drive (using subst command )
>> for a directory in C:\.
>> After moving using mv the link count for the file to which hard link is
>> created is reduced but after moving Path.move I don't see any reduction
>> in link count.
> Is this Cygwin or MKS "mv"? I'll bet it is copying the file in this 
> scenario and this will explain your observations. That is, it may 
> "think" it is being asked to move a file to another volume whereas in 
> fact the target maps to the same volume. One way to check if the file 
> has been copied is to use the isSameFile method.
Alan, This is MKS mv command. Now I tried with  DOS move and Cygwin mv, 
in both cases link count is not reduced even after moving hardlink to a 
drive which is a substitute for a folder.


More information about the nio-dev mailing list