Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"mv" broken?!?

Status
Not open for further replies.

SamBones

Programmer
Aug 8, 2002
3,186
US
I hate it when simple things "break".

I'm trying to rename a directory and it's not cooperating.

Code:
$ mv apache apache.2.2.24
mv: apache is a directory
$ yes, I know
ksh: yes,:  not found
$ mv -f ./apache ./apache.2.2.24
mv: ./apache is a directory

This is Solaris 10, if that helps any.

Code:
$ uname -a
SunOS servername 5.10 Generic_147147-26 sun4v sparc SUNW,SPARC-Enterprise-T5220

I own the source directory and the permissions on the parent directory are 777.

Code:
$ ls -lad . apache
drwxrwxrwx 162 auser    agroup       260 Aug 12 10:33 .
drwxr-xr-x  15 myuser   mygroup       15 Apr 11 10:47 apache

Any ideas?

 
Have you tried with a -t/-T switch?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Try truss to see where it is failing

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Did you try /usr/xpg4/bin/mv ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes, I did try [tt]/usr/xpg4/bin/mv[/tt] and got the same results.

But that's expected now that I discovered that I was just being stupid! [bigsmile]

The directory I was working in had a quarter bazillion files and directories in it, so it was "a little cluttered". It turns out that the name I was trying to rename the directory to, was already in use by a file. You can't rename a directory to a file.

If the source was a file, it would have correctly overwritten the destination file. If the destination was a directory, it would have dropped the source directory into the destination directory. But, you can't rename a directory to a file. And it was trying to tell me that.

Code:
$ mkdir zzz
$ touch zzz.txt
$ mv zzz zzz.txt
mv: zzz is a directory

Thanks for the [tt]truss[/tt] suggestion bluedragon2. That's usually my first response to something like this. I was just being lazy I guess.

Thanks for all the replies! [blush]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top