News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

filecopy

Started by felipe, February 25, 2019, 04:59:43 AM

Previous topic - Next topic

jj2007

Quote from: Vortex on March 02, 2019, 06:01:11 AMWhy the developers of the shell restricted themselves with the UNICODE version of CommandLineToArgv is a mystery.

For some time, M$ was convinced that UTF-16 was the future. The rest of the World was more convinced of UTF-8. Anyway, translating CommandLineToArgvW to UTF-8 (or any other charset, e.g. Norwegian) is very easy.

Vortex

Hi Jochen,

One can understand the point of view of M$ but coding the ANSI version of CommandLineToArgv should not be a big effort for them. Probably, they didn't bother to do so.

TimoVJL

Windows NT is internally UNICODE, so only CommandLineToArgvW was needed to support most filenames ?
May the source be with you

Vortex

Hi Timo,

M$ is providing both of the ANSI and UNICODE forms of the API functions. This is mostly the case but CommandLineToArgvW is missing it's companion when there are a lot of useless API functions.

nidud

#34
deleted

aw27

Simple filecopy example with full verbose error reporting.


H:\Masm32 Forum\getmainarguments> filecopy testfile.txt "my file 222"
Number of arguments: 3
Source File: testfile.txt
Destination File: my file 222
File Successfully Copied

H:\Masm32 Forum\getmainarguments> filecopy testfile.txt "my file 2"22"
Number of arguments: 3
Source File: testfile.txt
Destination File: my file 222
Error: The file exists.

H:\Masm32 Forum\getmainarguments> filecopy testfile.txt "my" file 222"
Number of arguments: 5
Syntax: Filecopy source destination

H:\Masm32 Forum\getmainarguments> filecopy testfile.txt "my file""222
Number of arguments: 3
Source File: testfile.txt
Destination File: my file"222
Error: The filename, directory name, or volume label syntax is incorrect.

H:\Masm32 Forum\getmainarguments> filecopy testfile.txt "my file"2"222
Number of arguments: 3
Source File: testfile.txt
Destination File: my file2222
File Successfully Copied

H:\Masm32 Forum\getmainarguments> filecopy "my file2222" "my file 3333"
Number of arguments: 3
Source File: my file2222
Destination File: my file 3333
File Successfully Copied