1

I am simply trying to copy files using cp -r /home/user/source/ /home/user/destination/ but it throws me the cp: cannot stat /source/filename.xxx error for some of the files. When I searched for this error, I found some matching questions such as this,this and this which although have the same error thrown by cp command but the reasons are different. Their solutions do not address my problem.

Upon looking closely, I saw that this error was being thrown only for files whose names contained Asian characters. For example,

cp: cannot stat /source/고정폭.collection

Does anyone have a solution for this? May be the default character encoding for my machine is not reading these file names.

EDIT 1: The output of my locale

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

EDIT 2: Output of ls -l in the source directory

ls: cannot access 고정폭.collection: No such file or directory
ls: cannot access 기존.collection: No such file or directory
ls: cannot access 모던.collection: No such file or directory
ls: cannot access 웹.collection: No such file or directory
ls: cannot access 재미.collection: No such file or directory
total 4
-????????? ? ?    ?      ?            ? 웹.collection
-????????? ? ?    ?      ?            ? 기존.collection
-????????? ? ?    ?      ?            ? 모던.collection
-????????? ? ?    ?      ?            ? 재미.collection
-????????? ? ?    ?      ?            ? 고정폭.collection
-rw------- 1 root root 856 Jul 24  2007 PDF.collection
8
  • What filesystem are those files stored on? Is it, by any chance, NTFS (Windows)?
    – rici
    Apr 4, 2015 at 0:30
  • source ext2/ext3, destination hfs+
    – Abhinav
    Apr 4, 2015 at 0:38
  • Ah. And you're using linux, not Mac OS X, right?
    – rici
    Apr 4, 2015 at 0:42
  • @rici yes, I am
    – Abhinav
    Apr 4, 2015 at 0:45
  • How did you create those files in the first place? I might have had an explanation for the filenames not working on HFS+, but I don't see why they would cause problems on ext4.
    – rici
    Apr 4, 2015 at 0:54

0

You must log in to answer this question.

Browse other questions tagged .