Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / using wxExecute on Linux

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. using wxExecute on Linux
#4896
Posted by: nicksteck 2004-07-24 04:12:16
Hello,

I am having trouble using wxExecute on Red Hat Linux. The code I'm running is:


        wxString cmd;
        wxArrayString output, errors;
        cmd.Printf(wxT("ls *x*"));

        wxExecute(cmd, output, errors);

        cout << "There are " << output.GetCount() << " rows of output\n";
        cout << "There are " << errors.GetCount() << " rows of error\n";

        if (output.GetCount() > 0)
          cout << "output is " << _T(output[0]) << endl;
        if (errors.GetCount() > 0)
          cout << "error is " << _T(errors[0]) << endl;



The output I get is:

There are 0 rows of output
There are 1 rows of error
error is ls: *x*: No such file or directory


What's the deal?!?!? Thanks.
Message2. Re: using wxExecute on Linux
#4900
Posted by: upCASE 2004-07-26 15:04:50
Hi!
To me this seems like the astreriks are not expanded by the shell, thus "*x*" is searched and not found. Not sure why this would happen. Maybe check the sources for wxExecute. Have you tried with quoting the command?
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2021-7-28  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0