Free Pascal 一次复制多个文件

问题描述 投票:0回答:1

我正在尝试将一些文件复制到某个目录。 这是安装过程的一部分。

这是我到目前为止的代码:

VAR S: STRING;
shell('cp *.rgd '+S);

其中“S”指向一个目录,*.rgd 实际上是 zip 文件,稍后将在安装过程中提取。

执行安装程序时会发生以下情况:

Renegade Version 1.10 Install Utility

This utility will install Renegade BBS Version 1.19/Alpha.
Please make sure that UNZIP and this file are located
in the same directory as the archive RGV110.ZIP.

You will only be asked to enter the main path for the BBS
directory.

Install Renegade BBS Version 1.10? Yes

Please enter main path for the bbs (Example: /opt/rg)
: /opt/rg2

Archive:  rgv10.zip
caution: filename not matched:  /opt/rg2
cp: missing destination file operand after '*.rgd/opt/rg2'
Try 'cp --help' for more information.
cp: missing destination file operand after '*.rgd/opt/rg2'
Try 'cp --help' for more information.
unzip:  cannot find or open /opt/rg2/bbs.rgd, /opt/rg2/bbs.rgd.zip or /opt/rg2/bbs.rgd.ZIP.
unzip:  cannot find or open /opt/rg2/data.rgd, /opt/rg2/data.rgd.zip or /opt/rg2/data.rgd.ZIP.
unzip:  cannot find or open /opt/rg2/misc.rgd, /opt/rg2/misc.rgd.zip or /opt/rg2/misc.rgd.ZIP.
unzip:  cannot find or open /opt/rg2/msgs.rgd, /opt/rg2/msgs.rgd.zip or /opt/rg2/msgs.rgd.ZIP.
unzip:  cannot find or open /opt/rg2/netfoss.rgd, /opt/rg2/netfoss.rgd.zip or /opt/rg2/netfoss.rgd.ZIP.
unzip:  cannot find or open /opt/rg2/prot.rgd, /opt/rg2/prot.rgd.zip or /opt/rg2/prot.rgd.ZIP.

An unhandled exception occurred at $0804957A :

EInOutError : File not found
$0804957A
$08049C1A

感谢您的宝贵时间。 非常感谢任何和所有的帮助。

command-line pascal
1个回答
0
投票

你确定你的代码是这样的吗

shell('cp *.rgd '+S);

而不是

shell('cp *.rgd' +S);

? 因为错误信息看起来像是你通过了

cp *.rgd/opt/rg2

到外壳(

*.rgd
/opt/rg2
之间没有空间)。 您提供的代码应该可以工作。

© www.soinside.com 2019 - 2024. All rights reserved.