By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,537 Members | 929 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,537 IT Pros & Developers. It's quick & easy.

C wrapper

P: n/a
Hi everyone,
i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from
C.....
tnx in advance

Seth

Jun 25 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On 25 Jun, 08:54, Seth...@gmail.com wrote:
i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from
C.....
I didn't entirely understand your question and you're probably close
to
being off-topic. You might be better off asking your question in a
platform specific group (Unix or Windows). You may be asking the
wrong
question (for instance a shell script *may* be a better idea than C,
and a "fork" may be better than "system").

If you want to call another program from C use system().
--
Nick Keighley

Jun 25 '07 #2

P: n/a
i don't think to be off-topic..however maybe i explained bad..
the problem is this:
i have a fortran software that runs in line command under linux.
i want to make a C wrapper to control the execution of that program.In
particolar i want to make a time-licence to sell it.
But i don't know how to start e how to make a wrapper that would to
this.
hope to get some help!!(and not to be off-topic!)

thanx
On 25 Giu, 10:07, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
On 25 Jun, 08:54, Seth...@gmail.com wrote:
i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from
C.....

I didn't entirely understand your question and you're probably close
to
being off-topic. You might be better off asking your question in a
platform specific group (Unix or Windows). You may be asking the
wrong
question (for instance a shell script *may* be a better idea than C,
and a "fork" may be better than "system").

If you want to call another program from C use system().

--
Nick Keighley

Jun 25 '07 #3

P: n/a
Se*****@gmail.com wrote:
Hi everyone,
i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from
C.....
tnx in advance

Seth
Since you are going to sell this stuff, either you give the people
here money for their advise, or you hire someone competent to do
the job. It would be unethical to ask people here to work for free
so that YOU can earn your money isn't it?

Jun 25 '07 #4

P: n/a
jacob navia <ja***@jacob.remcomp.frwrites:
Se*****@gmail.com wrote:
>i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from

Since you are going to sell this stuff, either you give the people
here money for their advise, or you hire someone competent to do
the job. It would be unethical to ask people here to work for free
so that YOU can earn your money isn't it?
I see nothing unethical about it. I see nothing wrong with asking for
advice, even if it happens to be about something for which one is
paid. People ask such questions here all the time.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 25 '07 #5

P: n/a
i don't want people here to work for me...im just asking some
advice,some documents to read and learn...
and almost all of people than ask for advice here is for "work", or
something like that...

On 25 Giu, 10:58, Keith Thompson <k...@mib.orgwrote:
jacob navia <j...@jacob.remcomp.frwrites:
Seth...@gmail.com wrote:
i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from
Since you are going to sell this stuff, either you give the people
here money for their advise, or you hire someone competent to do
the job. It would be unethical to ask people here to work for free
so that YOU can earn your money isn't it?

I see nothing unethical about it. I see nothing wrong with asking for
advice, even if it happens to be about something for which one is
paid. People ask such questions here all the time.

--
Keith Thompson (The_Other_Keith) k...@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

Jun 25 '07 #6

P: n/a
Se*****@gmail.com wrote:
On 25 Giu, 10:07, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
>On 25 Jun, 08:54, Seth...@gmail.com wrote:
>>i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from
C.....
I didn't entirely understand your question and you're probably close
to
being off-topic. You might be better off asking your question in a
platform specific group (Unix or Windows). You may be asking the
wrong
question (for instance a shell script *may* be a better idea than C,
and a "fork" may be better than "system").

If you want to call another program from C use system().
i don't think to be off-topic..however maybe i explained bad..
the problem is this:
i have a fortran software that runs in line command under linux.
i want to make a C wrapper to control the execution of that program.In
particolar i want to make a time-licence to sell it.
But i don't know how to start e how to make a wrapper that would to
this.
hope to get some help!!(and not to be off-topic!)
[Please don't top-post. I've correct your post here.]

It is starting to sound off-topic for this group. I understand you want
to construct a C program that wraps an external executable, but this is
just a guess, and the requirements are rather sketchy.

Given we are probably off-topic...

Since it doesn't matter what language, really, an executable is written
in, all you care about is that you have an executable of some sort that
you want to control access to.

That being said, how do you keep me from just running the executable
directly, bypassing your wrapper?

However, it sounds like you want to implement a license key system of
some sort, which is a surprisingly hard thing to get right (which is why
there are so many third-party licensing schemes you can buy). The idea
is to have the user provide a key that you can use to mathematically
determine if the software is unlocked. Part of the processing might
require a time and/or date component, which will further require
querying the system for the current time, and/or writing an obfuscated
cookie file in a known location so you can keep people from simply
hacking the system time to get around your check.

You need to determine your requirements and limitations, and then write
some code. Then come back with specific questions about C, if you are
writing C to solve this problem.

You can also set up a simple wrapper that calls home to get a license
key, which pushes all this processing to a web service of some sort.
This way you keep the client-side processing very simple.

This cat, it can be skinned in a variety of ways. But then again, who
wants a skinned cat?
--
clvrmnky <mailto:sp******@clevermonkey.org>

Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.
Jun 25 '07 #7

P: n/a
On Mon, 25 Jun 2007 07:54:31 -0000, Se*****@gmail.com wrote:
>Hi everyone,
i need to make a protection for a fortran software(a line command in
linux). My desire is to write a C wrapper that control the execution
of the program. Can someone help me? i dont know i to start it!My
question is also how can i make the fortran binary to execute from
C.....
tnx in advance
The only portable method of executing a generic line command from your
C program is the standard system() function. You can dynamically
build the command string you pass to the function so the command
parameters can be generated at run time.
Remove del for email
Jun 25 '07 #8

P: n/a
On Mon, 25 Jun 2007 08:16:51 -0000, in comp.lang.c , Se*****@gmail.com
wrote:

>i have a fortran software that runs in line command under linux.
i want to make a C wrapper to control the execution of that program.
You can use the system() function to run other programmes from within
a C programme.

If you want to find out whether the other programme worked, or to do
anything more complicated than just run it, with some commandline
arguments, you probably need to ask in a group specialising in
unix/linux programming.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jun 25 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.