Hi all!
I'm trying to do some automatic tasks using aMuleCmd, but I've ran into trouble.
I'm using the -c switch to run commands from a script, i.e aMuleCmd -c "search global cool stuff".
This works, but downloading a file doesn't.
I've read on the forum that you need to get the results before a download command and that there is no "session" information between two runs of the exe (fair enough).
The recommended "fix" for this is to use a file with a list of commands and then redirect the input from that file, i.e:
results
download 1
exit
However, this doesn't seem to work on Windows (XP but it shouldn't matter), i.e:
aMuleCmd < Input.txt
The exe reads the "results" command and executes that correctly, but then it repeatable executes the same command for ever.
This is true even with a single command.
I've also tried:
type Input.txt | aMuleCmd
This is odd since other applications handles this correctly.
First it should be quite simple to add some logic to the download command so that if no results have been requested before the command, it then issues a results command first and then continue with the download, i.e:
static bool gotResults = false;
if (command == "results"){
getResults();
gotResults = true;
}
if (command == "download"){
if (!gotResults){
getResults();
gotResults = true;
}
startDownload();
}
Secondly, it sure would be nice to have the redirection issue solves so that you could build a list of commands to execute.
To avoid platform issues with the above one could add an option (-cf, --command-file whatever) that reads a set of instruction from a text file and executes them in order.
The process I'm trying to automate doesn't justify the time it would take me to get the project compiling and adding these fixes myself, I was rather hoping that someone that does daily work on this would be kind enough to add any of these fixes.
Thanks in advance!
Cheers,
Eq