Problem with 'system' function

I'm nearly a beginner when it comes to C++, so excuse me for any omissions or silly questions!

Here goes....
Is there a limit to the size of the string you send to the 'system' function?

eg.
This works. No probs, no errors.
1
2
3
4
5
6
char update_str[600];

strcpy(update_str, "wget -q -O update_result http://abcd.networks.webnet.com/data/update?node=ABCD\&rmt=EFGHH\&pppp=5610\&nppn=5611*/");

i=system(update_str);


This does not work. Nothing returned. Just hangs.
1
2
3
4
5
6
char update_str[600];

strcpy(update_str,"/usr/opt/SUNWexplo/bin/solaris/curl.sparc -k -c cookies.txt -o /export/home/admin/ABCD1234.res --basic -L -v -u user2345:MINE_2017 https://home.abcd.networks.webnet.com/ordz/db777/f?p=PERT:PDATE_MINE:0::::P21_NODE,P21_RMT,P21_ACCESS,P21_PPPP_PRN,P21_NPPN_PRN,P21_PREP_CUSTOMPPPP,P21_NEW_CUSTOMNPPN:ABCD,EFGHH,,5610,5611,,;");

i=system(update_str);


Both commands basically do the same thing.
They BOTH work from the command line.
I'm aware of the inherent security issues there is with 'system'. That is not my concern. I just need to know why one works and the other doesn't.
If I'm missing any info here, please let me know.
Thanks.
Last edited on
If there is a limit, I can't think it would be that short. Ive sent much more than that.

What I would look at is explicit pathing, for example cookies.txt might not be visible where you ran the executable, but is from the real commandline ... try putting folder paths on *everything*.

I will do that right away!
Forgot about that stupid thing.

Thanks!
Topic archived. No new replies allowed.