LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   adding functionality to an existing program (https://www.linuxquestions.org/questions/programming-9/adding-functionality-to-an-existing-program-402244/)

unixbrain 01-11-2006 07:28 PM

adding functionality to an existing program
 
Recently, a friend of mine asked me to make a program. She has an accounting software, but it does not have a backup funtionality. She asked me to create a program that will make the program run a backup procedure automatically. The backup procedure involves a few steps, including setting the time & date back, printing a few reports, and backing up the reports.

So my question here is, how do I do it? It's true I do not have any experience in this, but if you were in my shoes, how would you do it?

xhi 01-11-2006 11:39 PM

is this software running on linux?

if so.. you should check out using cron and tar.. could easily make some b|g zip'd tarballs that are backed up every so often..

if not.. install linux.. :)

unixbrain 01-12-2006 02:39 AM

It is run in Windows. However, the backup procedure required her to access last year's General Ledger, make sure that they are posted, print out hardcopy and save a softcopy into a storage (Basically, that's the procedure). She wanted all these to be done in automation, with a click of a button. I hope I put myself clearly.

I am also curious how it is done in Linux.

schneidz 01-12-2006 02:05 PM

who is General Ledger?

not sure why this wouldn't work.

i created a launcher in cpp in my college years (it would launch calc.exe, then notepad.exe, the iexplore.exe). i prolly can't find the sourcecode now - i think it's 'NtCreateProcess()' or something.

can you create a launcher that would 'cp filename filename.bak', then run the program. (is there an lpr equivelent for m$ windoze.)

xhi 01-12-2006 02:35 PM

Quote:

Originally Posted by unixbrain
It is run in Windows. However, the backup procedure required her to access last year's General Ledger, make sure that they are posted, print out hardcopy and save a softcopy into a storage (Basically, that's the procedure). She wanted all these to be done in automation, with a click of a button. I hope I put myself clearly.

I am also curious how it is done in Linux.


I guess the first thing you need to do is determine if you need to get to any individual information stored in the programs data files.. or just make a copy of a certain file(s).. if all you have to do is to do a copy file(s) to a different location then you could just make a batch file that did it for you.. if you actually need to read from the programs datafile then you need to know how the program stores the information that you need to get to.. if you are doing this it will make it a little more complicated.. so im not going there for now..

so you could do as schneidz suggested and make a launcher app.. or you could just make a little batch file named backup and she could click it...

?? hth

graemef 01-12-2006 02:58 PM

One variation of program data files that are a little easier would be if it was stored on a database. But you really need to find out how the program stores this data. As a general rule if they are managed internally by the program then you're in trouble because it can be so hard to find out how the data is actually stored.

So to reiterate home work for tonight ;)... Find out which files you need to consider and how the files are actually stored.

graeme.

unixbrain 01-14-2006 06:50 PM

Thanks to all for your feedback. To answer xhi's question, I need to read from the data file. I think the files are stored in a database, but i cant determine the type of database the program is using. I will make a copy of the program and examine it in my computer.

Another question i would like to post here is, is it possible to create my own program that will execute the program and control all the functions in the program to run the procedure?

xhi 01-14-2006 09:08 PM

Quote:

To answer xhi's question, I need to read from the data file. I think the files are stored in a database, but i cant determine the type of database the program is using. I will make a copy of the program and examine it in my computer.
research, research, research.. i would start by tryign to find documentation on how the data files are constructed.. it possibly is outlined somewhere in the programs docs or other notes on the program.. more than likely it is not.. so you will have to reverse it.. the best thing to do is to save some dummy data that you know, then examine the file and see if you can find that data and determine how it is stored.. its hard to say what format the data file is.. the data could be in plaintext(yeh right!), binary, or binary and encrypted.. its not going to be real easy.. but it is possible.. just will take some work i guess.. i would start the reversing process by finding which dll/exe is doing the writing and tear it apart and see whats inside.. :)
Quote:

Another question i would like to post here is, is it possible to create my own program that will execute the program and control all the functions in the program to run the procedure?
as far as i know.. the only way that you would really be able to do anything with the other program is if either there are command line params available to run the program or if the libs are available freely so you could kind of clone the program... which if it is closed source, is quite unlikely..

kike_coello 01-16-2006 10:13 AM

yeah, if you want to have your program call other programs and interact with them you have to look at all the command line options that each program has

usually all you have to do is type the name of the program with a "--help" in linux or windows and you'll get a listing of the command line arguments. then put those in your script


All times are GMT -5. The time now is 03:16 AM.