I'm trying to copy some files over to a certain directory. Which is a part of an installation process.
Here's my code so far:
VAR S: STRING;
shell('cp *.rgd '+S);
Where "S" points to a directory and *.rgd are actually zip files that will be extracted later on in the installation process.
Here's what happens when the installation program is executed:
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
Thanks for your time. Any and all help is greatly appreciated.
@ignatius, well, from the messages being output from the command it looks like its malformed .
Show your [pascal] code.
From what I can ascertain, you are trying to copy *.rgd files from the rgv10.zip archive to the /opt/rg2/ directory , is this correct, if so, why not just do that
I think shell('unzip rgv10.zip *.rgd -d /opt/rg2/'); should also work correctly, given there aren't any .rgd files present in your current working directory.
No, you want unzip to match the *.rgd in the archive, not the shell.
The quoted "*.rgd" prevents the shell from accidental matching/expanding; it passes the dequoted *.rgd to the unzip.
Exactly, thus it should also work correctly without any quotes around *.rgd, as long as there aren't any .rgd files inside the directory (should I have phrased it differently?)
I haven't actually written anything in Pascal for over 15 or so years (let alone for *nix systems), so please bare with me
So on the other hand, how can we be sure, that the shell() function doesn't treat " as \" and i.e. passes that \" as a literal part of the filename to the shell? Another thing that's bothering me is: why is /opt/rg2/ hardcoded, when it's allegedly supposed to be provided as the only one of the installer inputs? (for now is it for debug purposes only?)
Anyway, sorry for the off-topic.
And also, not to "waste replies" on "academic discussions" only and for a broader context (I'd like to know more), @ignatius in your other thread you mentioned that you "ported" a DOS application to GNU/Linux
Why this particular version? (and is it 1.10 or 1.19/A?) Is the complete source code available publicly? (there are newer DOS versions available at https://www.rgbbs.info/ )
What particular data does the installer need to write ("manually") to certain files? What's the expected format of this data?
Why is the installer written in Pascal? (when it apparently looks, like a shell script would be more suitable for it)