• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

WAD Problem with copiing file

Mar 5, 2013
10
0
#1
I can't understand such dialog:​
TCC LE 13.06.74 Windows 7 [Version 6.1.7601]​
Copyright c 2013 JP Software Inc. Все права защищены​
S:\temp\TCCLE13>dir S:\copy-test​
Том на диске S​
Каталог S:\copy-test\*​
22.01.2013 18:32 <DIR> .​
22.01.2013 18:32 <DIR> ..​
......................................​
12.01.2013 14:03 19 aaa'aaa aaa.txt​
12.01.2013 14:03 19 King's.txt​
12.01.2013 14:12 19 King's Bounty.ISO​
12.01.2013 14:12 19 King's Bounty.txt​
76 байт (файлов: 4 , каталогов: 5 ) 65 536 байт занято​
807 731 200 байт свободно​

S:\temp\TCCLE13>copy "S:\copy-test\King's Bounty.txt" d:\aaa.txt
TCC: (Sys) Не удается найти указанный файл.
"S:\copy-test\King's Bounty.txt"
Скопировано файлов: 0
I have file "S:\copy-test\King's Bounty.txt", but I can't copy it!
When I use "Far Manager" for copy - I have no problems, but, I need command line fore copiing such files.
Where is problem?
 
#2
I wonder if either the file or the directory is marked Hidden or System? Unless you explicitly ask for such directories or files with the attribute sxitch, e.g., /A:H, they are ignored as if they did not exist BTW, AFAIK none of the JPsoft staff can read Russian, but you appear to understand English, try to switch TCMD to English to report your problems.
 

rconn

Administrator
Staff member
May 14, 2008
10,315
93
#3
The problem is probably with your destination file ("d:\aaa.txt"), not the source file. When COPY gets an error from Windows, it doesn't know whether the source or destination file is the problem, so it has to guess which one to display. If the target file exists and is read-only (or hidden or system), or if you're trying to copy a file into a root directory on Windows 7 and you're not in an elevated process, Windows will refuse to do the copy. I have no idea what the Russian error message means, but it's returned by Windows, not TCC. (TCC just calls the Windows CopyFile API to perform the file copy.)

What happens if you try that command line in CMD?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,497
45
Albuquerque, NM
prospero.unm.edu
#6
Yes. But without russian.dll I have russian message again:
Yes. That text is provided by Windows, not TCC.

Can you copy the file using wildcards -- *.TXT for example?

Are you typing out the entire filename? If so, you might try using tab completion instead. If there are strange characters in the filename, tab completion might work around the problem.

Does the same command work in CMD.EXE ?
 
#7
[...] if you're trying to copy a file into a root directory on Windows 7 and you're not in an elevated process, Windows will refuse to do the copy.
That doesn't seem to be true.
Code:
v:\> echo %_elevated & copy avtemp.btm l:\
0
V:\avtemp.btm => L:\avtemp.btm
    1 file copied
 
Mar 5, 2013
10
0
#10
Yes. That text is provided by Windows, not TCC.

Can you copy the file using wildcards -- *.TXT for example?

Are you typing out the entire filename? If so, you might try using tab completion instead. If there are strange characters in the filename, tab completion might work around the problem.

Does the same command work in CMD.EXE ?
It is interesting, that:
TCC LE 13.06.74 Windows 7 [Version 6.1.7601]
Copyright 2013 JP Software Inc. All Rights Reserved

S:\temp\TCCLE13>mkdir D:\bbbbb

S:\temp\TCCLE13>copy s:\copy-test\*.txt d:\bbbbb
S:\copy-test\aaa'aaa aaa.txt => D:\bbbbb\aaa'aaa aaa.txt
S:\copy-test\King's.txt => D:\bbbbb\King's.txt
S:\copy-test\King's Bounty.txt => D:\bbbbb\King's Bounty.txt
3 files copied

S:\temp\TCCLE13>
For CMD.exe the same:
Microsoft Windows [Version 6.1.7601]
(c) Корпорация Майкрософт (Microsoft Corp.), 2009. Все права защищены.

C:\Windows\system32>copy "S:\copy-test\King's Bounty.txt" D:\aaa.txt
Не удается найти указанный файл. (cmd.exe can't find file "S:\copy-test\King's Bounty.txt" )

C:\Windows\system32>mkdir d:\aaaaa

C:\Windows\system32>copy s:\copy-test\*.txt d:\aaaaa
s:\copy-test\aaa'aaa aaa.txt
s:\copy-test\King's.txt
s:\copy-test\King's Bounty.txt
Скопировано файлов: 3. (3 files copied)

C:\Windows\system32>
 
Mar 5, 2013
10
0
#11
Information for mind:
S:\temp\TCCLE13>copy "s:\copy-test\aaa'aaa aaa.txt" d:\aaa.txt
S:\copy-test\aaa'aaa aaa.txt => D:\aaa.txt
1 file copied
:-(((((
and
C:\Windows\system32>copy "s:\copy-test\aaa'aaa aaa.txt" d:\bbb.txt
Скопировано файлов: 1. ( 1 file copied )
for CMD.EXE
:-((((((((((
But Far.exe can copy both files without questions.
Question: problem in Windows API or in "copy program"?
 
#12
My computer at work does that something like that for the C: drive. I can create directories in the root folder of the drive, but am unable to create files in the root folder. That's what your problem looks like.
 
Mar 5, 2013
10
0
#15
My computer at work does that something like that for the C: drive. I can create directories in the root folder of the drive, but am unable to create files in the root folder. That's what your problem looks like.
I write file s:\copy-test\test.btm, that contain 3 strings:
mkdir d:\aaaaaaa
copy "S:\copy-test\King's Bounty.txt" d:\aaaaaaa\aaa.txt
copy "s:\copy-test\aaa'aaa aaa.txt" d:\aaaaaaa\bbb.txt
and I run it:
TCC LE 13.06.74 Windows 7 [Version 6.1.7601]
Copyright 2013 JP Software Inc. All Rights Reserved

S:\temp\TCCLE13>s:\copy-test\test.btm
mkdir d:\aaaaaaa
copy "S:\copy-test\King's Bounty.txt" d:\aaaaaaa\aaa.txt
TCC: (Sys) S:\copy-test\test.btm [2] Не удается найти указанный файл. (tcc.exe can't find file "S:\copy-test\King's Bounty.txt" )
"S:\copy-test\King's Bounty.txt"
0 files copied
copy "s:\copy-test\aaa'aaa aaa.txt" d:\aaaaaaa\bbb.txt
S:\copy-test\aaa'aaa aaa.txt => D:\aaaaaaa\bbb.txt
1 file copied

S:\temp\TCCLE13>
Why such difference?????
Can You create files and directories with same names and test "test.btm"?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,497
45
Albuquerque, NM
prospero.unm.edu
#16
I can't understand, how "using tab completion" can help in .btm-file?
In a .BTM file it can't. I ask you to try because I think that the filename you are typing is not the same as the file's actual name. In particular, I suspect that you may be typing Cyrillic letters where the filename contains Latin letters. (Or the other way around, though that is less likely.)

For example, the Cyrillic letter В (veh) looks like the Latin letter B (bee), but they are not the same letter. If you substitute one for the other, you'll get a file-not-found error. The same problem exists if you're typing Latin letters, but whoever created the file used a Russian К (kah) or a Greek Κ (kappa) in place of the English Kay. And so on.

If you can copy the file using tab completion, that would be a strong clue that the actual filename is not the same as what you are typing.
 
Mar 5, 2013
10
0
#17
If you can copy the file using tab completion, that would be a strong clue that the actual filename is not the same as what you are typing.
Yes! "tab completion" works. How I understand, filename include "russian" letter, but I gave the name from output of "dir"-command, so we find another bug(may be). Don't close the theme, please...
 
#18
Yes! "tab completion" works. How I understand, filename include "russian" letter, but I gave the name from output of "dir"-command, so we find another bug(may be). Don't close the theme, please...
How did you copy the name from the DIR command into the COPY command? One method is redirection, another is copy and paste, which do not depend on human character recognition.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,497
45
Albuquerque, NM
prospero.unm.edu
#19
You could examine the filenames in that directory by doing something like this:

Code:
for %f in ( S:\copy-test\* ) echo %@filename[%f]  %@ascii[%@filename[%f]]
Values from 33 to 64 are punctuation and digits; 65 to 122 are mostly Latin letters; 913 to 969 are Greek; and 1040 to 1103 are Cyrillic.
 
Mar 5, 2013
10
0
#21
You could examine the filenames in that directory by doing something like this:

Code:
for %f in ( S:\copy-test\* ) echo %@filename[%f]  %@ascii[%@filename[%f]]
Values from 33 to 64 are punctuation and digits; 65 to 122 are mostly Latin letters; 913 to 969 are Greek; and 1040 to 1103 are Cyrillic.
Code:
S:\copy-test\tccle13\2>for %f in ( S:\copy-test\* ) echo %@filename[%f] %@ascii
[%@filename[%f]]
aaa'aaa aaa.txt 97 97 97 39 97 97 97 32 97 97 97 46 116 120 116
King's.txt 75 105 110 103 39 115 46 116 120 116
King's Bounty.ISO 75 105 110 103 8217 115 32 66 111 117 110 116 121 46 73 83 79
King's Bounty.txt 75 105 110 103 8217 115 32 66 111 117 110 116 121 46 116 120 116
test.btm 116 101 115 116 46 98 116 109
test1.btm 116 101 115 116 49 46 98 116 109
How I understand we interesting in 8217? And what now?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,497
45
Albuquerque, NM
prospero.unm.edu
#22
Code:
S:\copy-test\tccle13\2>for %f in ( S:\copy-test\* ) echo %@filename[%f] %@ascii
[%@filename[%f]]
aaa'aaa aaa.txt 97 97 97 39 97 97 97 32 97 97 97 46 116 120 116
King's.txt 75 105 110 103 39 115 46 116 120 116
King's Bounty.ISO 75 105 110 103 8217 115 32 66 111 117 110 116 121 46 73 83 79
King's Bounty.txt 75 105 110 103 8217 115 32 66 111 117 110 116 121 46 116 120 116
test.btm 116 101 115 116 46 98 116 109
test1.btm 116 101 115 116 49 46 98 116 109
How I understand we interesting in 8217? And what now?
Aha! Not a letter after all, but the punctuation!

You can type that character by holding down the left ALT key while typing the number 08217 on the numeric keypad (the numbers on the right side of the keyboard, not the ones at the top). Yes, you do need to type the leading zero.

Alternatively, you can rename the offending files:

Code:
cdd s:\copy-test
for %f in ( *%@char[8217]* ) ren /p "%f" "%@replace[%@char[8217],%@char[39],%f]"
Character 8217 is the Unicode right single quotation mark. In most fonts it looks a little different from the ASCII apostrophe, but in a few it looks the same....
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,497
45
Albuquerque, NM
prospero.unm.edu
#23
You can type that character by holding down the left ALT key while typing the number 08217 on the numeric keypad (the numbers on the right side of the keyboard, not the ones at the top). Yes, you do need to type the leading zero.
If you want to do this in a batch file, then you must save the batch file as Unicode (UTF-16). How you do that depends on your text editor. You could also use a question mark to match the problem character:

Code:
copy "s:\copy-test\king?s bounty.txt" d:\
 
Top Bottom