logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Wx::Perl::ProcessStream: msg#00161

Subject: Re: Wx::Perl::ProcessStream
Hi Eric,

Thanks for the pointer to ExecuteArgs;

Wx::Perl::ProcessStream->OpenProcess() now accepts an array ref or a command 
string as the first argument.

The array form is implemented simply as a call to Wx::ExecuteArgs;

Added a test and uploaded a new version.

Regards

Mark

Eric Wilhelm wrote:
> # from Mark Dootson
> # on Monday 26 March 2007 09:03 pm:
> 
>> I'd appreciate any comments and views on code, process and namespace.
> 
> I would really like to see some sort of list-context (\@command or 
> otherwise) functionality.  I've only briefly looked at the source, so 
> there might be some underlying implementation nit forcing your hand 
> here.
> 
>   my $process = Wx::Perl::ProcessStream->OpenProcess(
>     $command, $name, $eventhandler);
> 
> With a quick glance around, it seems that Wx.pm supports the 
> "wxExecute(char **argv,..." form via ExecuteArgs().  It also looks like 
> this would be no different than using ExecuteCommand() in terms of 
> firing the callback.  Perhaps detecting whether $command is an array 
> ref would do it?
> 
> Of course, I'm assuming here that the list form in ExecuteArgs() carries 
> all of the not-running-a-shell benefits of `exec(@list)` (such as "no 
> need to escape spaces in filenames" to name one very common example.)  
> If I'm wrong, ugh.  See also:  execvp(3).  The wx docs aren't exactly 
> clear on what happens so ... at least the unix implementation 
> ("src/unix/utilsunx.cpp") reads as if they've reinvented shell 
> escaping.  Neat.  So, maybe the semicolon ends up as an argument (I 
> think perl goes out of its way to fire-up a shell.)  Ooh.  The windows 
> implementation puts everything together and calls the string form due 
> to the nature of CreateProcess.  Yay.  Well, I see from win32/win32.c 
> create_command_line() that perl works a little harder.
> 
> In any case, I typically build command and arguments as lists.  Would 
> rather not have to do join(" ", map({escape($_)} @list)) and then have 
> wx go through that and split on spaces when the operating system is 
> otherwise quite capable of executing a list of "command and arguments".  
> I guess just leave "what should we do when the operating system is not 
> so capable?" as an exercise for the reader.
> 
> --Eric



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe