C wrapper

Discussion in 'C Programming' started by Seth7TS@gmail.com, Jun 25, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. On 25 Jun, 08:54, 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
    Nick Keighley, Jun 25, 2007
    #2
    1. Advertising

  3. Guest

    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 <>
    wrote:
    > On 25 Jun, 08:54, 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, 2007
    #3
  4. jacob navia Guest

    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?
    jacob navia, Jun 25, 2007
    #4
  5. jacob navia <> writes:
    > 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) <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"
    Keith Thompson, Jun 25, 2007
    #5
  6. Guest

    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 <> wrote:
    > jacob navia <> writes:
    > > 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) <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, 2007
    #6
  7. wrote:
    > On 25 Giu, 10:07, Nick Keighley <>
    > wrote:
    >> On 25 Jun, 08:54, 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:>

    Direct replies will be blacklisted. Replace "spamtrap" with my name to
    contact me directly.
    Clever Monkey, Jun 25, 2007
    #7
  8. On Mon, 25 Jun 2007 07:54:31 -0000, 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
    Barry Schwarz, Jun 25, 2007
    #8
  9. On Mon, 25 Jun 2007 08:16:51 -0000, in comp.lang.c ,
    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
    Mark McIntyre, Jun 25, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Duffy
    Replies:
    0
    Views:
    3,985
    Brendan Duffy
    Jul 25, 2003
  2. Nilsson Mats

    Wrapper on magic line?

    Nilsson Mats, Dec 9, 2003, in forum: Perl
    Replies:
    0
    Views:
    602
    Nilsson Mats
    Dec 9, 2003
  3. Showjumper
    Replies:
    2
    Views:
    444
    Showjumper
    Jul 4, 2003
  4. Brian Pittman

    wrapper function for uploading files

    Brian Pittman, Jul 30, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    482
    Kevin Spencer
    Jul 30, 2003
  5. Marlene Arauz

    Deployment of DTSPKG.DLL wrapper

    Marlene Arauz, Nov 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    528
    Marlene Arauz
    Nov 10, 2003
Loading...

Share This Page