From: Phil Romero Date: 2009-06-17T09:47:54+09:00 Subject: Re: Which is more expensive Rename or Move? On Tue, Jun 16, 2009 at 11:45 AM, Mrmaster Mrmaster wrote: > Kyle Schmitt wrote: >> Because moving and renaming files consist of the same operations. >> >> To really really overly simplify it, moving a directory primarily >> involves updating the directory, not every node under it. >> >> I'm a bit busy to lookup papers on how it works, but do some googling >> for how filesystems work. > > Thanks, I'll do the research. I just neded to know of the costs :) > -- > Posted via http://www.ruby-forum.com/. > > Just to add a bit more to this conversation, the only time an mv operation would be more expensive is in the case of actually mv'ing across filesystems. You could have mv'd a file from say your /home/username directory on sda1 to /newhome/username on sda2 (two physically different partitions). Strange that this would come up. I think rename is mv with a cross filesystem limitation. I don't use rename for anything in *nix, always has been mv.