Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

Can't copy or move some files

cp: cannot stat 'filename': No such file or directory

7:56 pm on Jul 28, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Aug 29, 2003
votes: 0

I am having a hard time moving some files and get the following error:

cp /dir/dir2/filename.jpg ./

cp: cannot stat `/dir/dir2/filename.jpg': No such file or directory

However, the file does exist as I can view the file(image) using a web browser. I have also tried using relative and direct directory paths - but nothing helps - I can't move or copy the files.

Now, get this, if I am in the directory where the files are, I can mv or cp them to where i want them to go...but not the other way around. Now, I'm possitive it is not the way I am specifying the directory in my example above, because I can move test files I make, just not the .jpg image files.

The .jpg files I'm trying to move were uploaded using a php upload script I made. I don't think the images are defective, cause I can view them in a browser. Is there anything that could be causing the problem?

The reason I came across this is because I was making another php script to make thumbnails of the images I upload.... but that php-thumbnail script said that the files didn't exist (and yet I can view them).

8:03 pm on July 28, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 28, 2003
votes: 0

The only thing I can think of is that there are possibly symlinks somewhere in your path that cp/mv doesn't like.

Check the whole path for symlinks that may go down levels (../somwhere) and so on.

6:15 pm on July 29, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 11, 2003
votes: 12

Also check the file permissions.