liliafan 53 Junior Poster

Hi infamous,

Well on looking on /usr/include/string.h I find:
extern char *strtok_r(char *, const char *, char **);

When I attempt to change:

char *s;
to
int s;

I get rid of that error and get the following error:

implicit declaration of function `int strtok_r(...)'

Great isn't it, it says it wants an int even although there is no way I can see how the function would work with an int, when it an int it causes an error still.

Any further advice graciously recieved.

Thanks
Ben

liliafan 53 Junior Poster

Hi I am getting an error with some code, it compiles fine on linux but it is throwing an error on solaris, it is to do with strtok_r, the following is the error message:

sku_cache.cpp:150: implicit declaration of function `int strtok_r(...)'
sku_cache.cpp:150: assignment to `char *' from `int' lacks a cast

The code in question is:

char *svptr; 
    char *s;    
    char cont[input.length()]; 
    const char *delim = " ";   
    const char *sdelim = "0123456789"; 
    
    sprintf(cont, "%s", input.c_str()); 
       
    s = strtok_r(cont, delim, &svptr);

As I said this compiles without error on linux but using solaris 8 it complains, on checking the man pages on both machines:

Solaris:
char *
strtok_r(char *str, const char *sep, char **last);

Linux:
char *strtok_r(char *s, const char *delim, char **ptrptr);

Any help would be greatly appreciated.

Thanks

Ben

liliafan 53 Junior Poster

I think that is very much personal opinion, and depends on system type, for example in my opinion UFS on solaris is much better that UFS on openbsd, since Sun have made so many alterations to the version of UFS that they use, to the best of my knowledge UFS on bsd isn't journalled.

Additionally as I seem to recall ext2 (which is most similar to ufs) benchmarks faster than UFS (although ufs can be more stable), and reiserfs benchmarks at about the same speed, please note that is based on memory since I can't find the benchmark results at the moment.

liliafan 53 Junior Poster

Hello
Is it java(JSP, Javabean, Servlets), j2ee(EJB-3tier) & which best database is suited? If plan in advance than time is saved.

Actually the best ecommerce software I have ever used (I have used dozens over the years) is Intershop, written in 90% perl (fast_cgi) 10% C, the database is Sybase ASE.

My preferences for an ecommerce system depending on expected loads and budgets of course would be mod_perl, C++, using a postgres database unless you are expecting massive load and serious business in which case oracle.

liliafan 53 Junior Poster

Excellent I think I understand what you mean now, I will play about with execl, and RTFM :)

Thanks again

liliafan 53 Junior Poster

dev-c++ is cool that is basically gnu gcc ported to windows, if you copy the example from bleek and paste it into your ide , you can then click the "play" button to execute it, it will then compile and run the program, if you want to properly compile you will find the compile command in one of the menus at the top, then just add to that program and play about.

liliafan 53 Junior Poster

what u want to do is fork() off a child and have the child exec().

Hi this is something I need to investigate a little further, however, I am really trying to avoid any fork()'s in the program, the program is actually a searchengine for an ecommerce site, and some of the spec's for the project include keeping the program contained as much as possible, so if the exec* series of functions all cause forks is there any alternative functions that specifically contain functions in a thread, one of the other reasons is when the program terminates there is a possibility that it will not have time to tidy child processes, as such one of the reasons for using threads is that it should destroy the thread when the program exit()'s. I know the chances of there being a function like I am describing are fairly remote but you never know unless you ask right?

:o)

Thanks for you answer if there isn't anything more like what I am looking for then I will use one of the examples you gave.

Regards
Ben

liliafan 53 Junior Poster

Well I am a perl programmer primarily, but I also really like ksh, both of which are pretty good with cgi

liliafan 53 Junior Poster

I want to know how to get started to make a program in C++. I have read up on the material and I just don't know where to go from there. i would like the program to work on a windows platform.

Which compiler are you using?

liliafan 53 Junior Poster

Postfix is even easier, 5 minutes to install and configure

liliafan 53 Junior Poster

Reiserfs is fastest, ext3 is a little more safe, ext2 is fastest, different filesystems for different jobs, oh and UFS on solaris with logging on.
/ - ext3
/boot - ext3
/var - ext2
/home - reiserfs
/tmp - ext2
/usr - reiserfs

liliafan 53 Junior Poster

My favorites in order:

Gentoo 1.4 (but it is complicated and not for newbies)
Suse 9.0 (Fast and very very easy)
Debian (Easier than it used to be and very powerful)

I always recommend Suse for newbies, I have been using it on and off since version 6.2 in 1998.

liliafan 53 Junior Poster

Hi

I am trying to figure out how to do something for a program I am writing I am fairly new to C++ I have only been using it for about 3 months.

Basically I want to launch a pthread which is easy enough but from within that thread I want to launch a perl script, I don't want the perl embedded, something like:

exec("/usr/local/bin/perl", "sqldaemon.pl", "/var/log/error");

kind of thing, the "sqldaemon.pl" and "/var/log/error" sections being arguements to be passed to the script.

I have gone through my books but I can't find any reference on how to launch an external application, this application will also be running in a daemon mode and wont terminate until the main program exits, which is why it is launched from a thread instead of from the main program.

Any help on the correct syntax for launching external applications with arguements would be appreciated.

Thanks

Ben

liliafan 53 Junior Poster

Hey I have just been working on a program that makes a link to a sybase database (ASE 12.4) and it is very complicated, I would research FreeTDS (freetds.org) ctlib, db-lib and Sybase OpenClient (sybase.com) in the end I came up with an alternative solution using embedded perl to make the connection with DBI and DBD::Sybase, it was a lot easier.