wjh*_*wjh 3 windows batch-file
我编写了一个批处理脚本,它登录到我的 ftp 服务器,然后导航到一个目录。我在使用 mget 命令时遇到问题,我希望它下载目录中的每个 .dat 文件,但它只是返回此错误:
Cannot access file '/home/minecraft/multicraft/servers/server267/world/players/*.dat':No such file or directory.
200 Type set to: ANSI
Cannot find list of remote files
Run Code Online (Sandbox Code Playgroud)
这是我的脚本(从 cmd 运行)
open 66.71.244.202
USER
PASSWORD
cd /world
cd players
mget *.dat
Run Code Online (Sandbox Code Playgroud)
小智 6
那是设计使然。FTP 规范 (RFC 3659) 的最新更新明确禁止它(参见第 2.2.2 节):
For the commands defined in this specification, all pathnames are to be treated literally. That is, for a pathname given as a parameter to a command, the file whose name is identical to the pathname given is implied. No characters from the pathname may be treated as special or "magic", thus no pattern matching (other than for exact equality) between the pathname given and the files present in the NVFS of the server-FTP is permitted.
Clients that desire some form of pattern matching functionality must obtain a listing of the relevant directory, or directories, and implement their own file name selection procedures.
Run Code Online (Sandbox Code Playgroud)