Which language for this problem

Started by
12 comments, last by Zahlman 19 years, 4 months ago
Hello, I am working on a program which downloads a file from a server and then executes stuff based on it, and then uploads a resulting file back to the server. I have writen a large portion of the code already in C++, but it is getting out of hand with all of the system calls and trying to debug a multithreaded program. It's multithreaded because I want a systray icon to show up with a play/pause option on it. Right now, it also pops up a bunch of dos windows really fast which is no good. I know that this is because I am using a system( ); call, but the other alternatives get very messy. Here are the steps this program must complete: 1) Download a zip file 2) extract the zip file 3) load an ini file which holds all of the filenames for this particular job 4) check the ini file and make sure all of the dependencie files are up to date. If not, download the new version from the server. 5) execute some batch files that were in the zip file 6) execute a script (This is the part where all of the interesting, time consuming work is done) 7) possibly run some more batch files (depends on what it has in the ini) 8) zip everything back up 9) upload the zip back to the server 10) rinse and repeat Also, I must have a method for running this program in idle as well as pause it at any point of time. Does anyone have any ideas on which language might be better than C++? I have written a lot of helpful scripts in perl, which seems well suited for this job, but I don't want to force the users to download an extra 20MB implementation of perl. Is there an easy way to do something like this or should I just keep plowing ahead in C++? Thanks! Dwiel
Advertisement
Have you looked for software that already does something similiar?

For example, I'm not sure what you're trying to do, but sometyhing like Ajanta might do something like you're looking for... (though perhaps not any of the specifics...)

and, of course, If I were writing it, It'd be in python.
I'd use Python. If you want to package it up into an executable, use py2exe.
Quote:Original post by petewood
I'd use Python. If you want to package it up into an executable, use py2exe.


+1. You're doing mostly "glue code" type stuff, with some file manipulation (and upload/download). Perl might be an option too, depending on personal taste (it's what I would have recommended before I learned Python ;) )
Fourthed Python, there are libs to do almost all of that, you'd only have to write a tiny amount of code :)
Download Cygwin and write a bash script; it will probably be less than 20 lines.
Quote:Original post by Anonymous Poster
Download Cygwin and write a bash script; it will probably be less than 20 lines.


!

what about the thing of not requiring others to download stuff?
Quote:Original post by petewood
what about the thing of not requiring others to download stuff?


Ah...I missed that part of the OP, sorry. However, the tools used in the script would be small (sh, wget, unzip, zip, maybe sed), so it's possible that they could be bundled with the application depending on how it is to be distributed.
I pretty much got it all working using some of those utilities like wget and a command-line zip-utility. That and a combination of short DOS batch files (easily converted to linux) and 'compiled' perl code which does the uploading. I am now working on using Python to do this as hopefully the compiled code will be much smaller.

I think I am going to keep the multi-threaded part in C though because I am familiar with it... Also, the only way I can allow for pausing in my main loop is to call it using C/C++...

It looks like I'll just be coding more of the glue with python. Is there a preffered Python compiler?

Thanks!

Dwiel
Quote:Original post by Tazzel3D
Is there a preffered Python compiler?

There's really only the one (although there is Jython too).

This topic is closed to new replies.

Advertisement