Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > mv directories?

mv directories?
Thread Tools
aquapaul
Guest
Status:
Reply With Quote
Nov 9, 2000, 04:13 AM
 

Can someone explain why the mv command won't move directories on OS X PB?
In every un*x I've used you can use mv dir1 dir2, but not osx!
How are you meant to do this?
     
Fresh-Faced Recruit
Join Date: Oct 1999
Location: Brookline, Massachusetts, USA
Status: Offline
Reply With Quote
Nov 9, 2000, 03:59 PM
 
It works for me... what error are you getting?

/Users/lcampbel/tmp> mkdir foo
/Users/lcampbel/tmp> ls -l
total 0
drwxr-xr-x 2 lcampbel staff 24 Nov 9 16:55 foo/
/Users/lcampbel/tmp> mv foo barzle
/Users/lcampbel/tmp> ls -l
total 0
drwxr-xr-x 2 lcampbel staff 24 Nov 9 16:55 barzle/
/Users/lcampbel/tmp>
     
Grizzled Veteran
Join Date: Sep 1999
Location: Boston, MA USA
Status: Offline
Reply With Quote
Nov 9, 2000, 10:00 PM
 
Originally posted by aquapaul:

Can someone explain why the mv command won't move directories on OS X PB?
In every un*x I've used you can use mv dir1 dir2, but not osx!
How are you meant to do this?
Well, if the directories aren't empty I think you have to use "mv -R dir1 dir2". Actually, might be "mv -r dir1 dir2". Can't remember right now.
     
aquapaul
Guest
Status:
Reply With Quote
Nov 10, 2000, 07:25 AM
 
Hmmm. Well that *should* work, but my mv (/bin/mv) only supports the -f -i switches.

mkdir foo; mv foo bar -- that works.
mkdir foo; vi foo/file.txt (enter text); mv foo bar -- this also works.

But copy files in to foo from say another dir, or whatever, and then try to rename it and I get this error:

/users/paul% mv dir1 dir2
mv: rename dir1/ to dir2: Is a directory

Is it just my mv being cheeky?

Paul

     
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Nov 10, 2000, 02:34 PM
 
It's not just you. I too have run into this problem and didn't know what to think of it until now. I'm assuming it's caused by files that have resource forks since it worked when the dir contained a plain text file. Time to go dig up that paper they presented on the OSX filesystem handling at USENIX.
     
Grizzled Veteran
Join Date: Sep 1999
Location: Boston, MA USA
Status: Offline
Reply With Quote
Nov 11, 2000, 06:20 PM
 
Originally posted by aquapaul:
Hmmm. Well that *should* work, but my mv (/bin/mv) only supports the -f -i switches.
Yeah, my bad. I was confusing cp and rm with mv.
I guess I'm not sure why it's not working for you. Seems weird.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:41 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2