473,761 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C wrapper

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
8 2105
On 25 Jun, 08:54, Seth...@gmail.c om 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
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.c om 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
Se*****@gmail.c om 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
jacob navia <ja***@jacob.re mcomp.frwrites:
Se*****@gmail.c om 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_Keit h) 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
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.orgwr ote:
jacob navia <j...@jacob.rem comp.frwrites:
Seth...@gmail.c om 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_Keit h) 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
Se*****@gmail.c om wrote:
On 25 Giu, 10:07, Nick Keighley <nick_keighley_ nos...@hotmail. com>
wrote:
>On 25 Jun, 08:54, Seth...@gmail.c om 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
On Mon, 25 Jun 2007 07:54:31 -0000, Se*****@gmail.c om 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
On Mon, 25 Jun 2007 08:16:51 -0000, in comp.lang.c , Se*****@gmail.c om
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2778
by: Edvard Majakari | last post by:
Hi, I was wondering what would be the most elegant way for creating a Python class wrapper for a command line utility, which takes three types of arguments: 1. options with values (--foo=bar) 2. boolean options (--squibble) 3. data lines (MUNGE:x:y:z:frob)
12
4101
by: Egil M?ller | last post by:
Is there any way to create transparent wrapper objects in Python? I thought implementing __getattribute__ on either the wrapper class or its metaclass would do the trick, but it does not work for the built in operators: class Foo(object): class __metaclass__(type): def __getattribute__(self, name): print "Klass", name
9
2426
by: WithPit | last post by:
I am trying to create an Managed C++ Wrapper around an unmanaged library which contains C++ code. Some of the unmanaged methods returns an returntype which is of the abstract base type (for example unmanagedObject). How can i convert this to the managed abstract basetype? Hope somebody can help me Thanx
4
1934
by: Stephen | last post by:
Hi I am currently developing a web application that has a third party component on it. The third party component is a graph component from Xceed that uses a number of dlls. The problems occur when we attempt to deploy the application and the third party component causes a security exception. Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required...
4
1971
by: peterbe | last post by:
This works exactly as you would expect:: from time import sleep def foo(on='ABC'): for e in list(on): sleep(1) yield e When I run this on the command line It takes about 3 seconds to complete and the first letter is shown after 1 second.
22
2511
by: linwu02 | last post by:
I am trying to write a Wrapper for our web wrapping engine, Cameleon. Currently Cameleon is able to answer certain SQL queries but with a restriction that all SQL queries must have a predicate. This is very similar to the BLAST wrapper. For example, Cameleon can answer queries like this by accessing Yahoo's IBM finance webpage Select Headlines, LastTrade From yahoo where Ticker='IBM' However, this query is meaningless if the predicate...
9
3459
by: Julien Biezemans | last post by:
Hi! Here is the problem: I'd like to restrict local filesystem stream operations to one directory just like a root jail. fopen('/file.bin') would actually open /some/path/file.bin. One goal of this behavior is to prevent Xinclude instructions to point to "out of application directory" files when processed by the XSLT processor, among other things.
16
3449
by: utab | last post by:
Dear all, In programming terminology, what is a wrapper and where is it used? Regards
4
2131
by: a_agaga | last post by:
Hi! Do you know different alternatives to convert exceptions in many methods of some wrapper classes. User -Wrapper classes -LibraryClasses -... Wrapper classes catch an exception of only one type, let's call it e.g. "InternalException_c". There are no other types of exceptions, which should be catched /
3
2281
by: bobc | last post by:
Using SQL Server 2000... I wrote a wrapper to call a sub proc (code provided below). The intended varchar value returned in the output parameter of each proc is a string implementation of an array. (The string separates elements by adding a period after each value. e.g. 1. 2. 3. 4. 5. etc., although my simplified example only creates two elements.) My vb.net calling code parses the returned string into individual elements.
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.