[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Re: checkout to stdout (cvs -p)?

From: Gale, David <David.Gale_at_Hypertherm.com>
Date: 2006-05-18 15:04:57 CEST

Saku Ytti wrote:
> On (2006-05-18 13:47 +0200), Anders J. Munch wrote:
>
>> So what's a FILEHANDLE in perl? Can it be some sort of virtual file
>> that when written to builds up a string (like stringstream in C++ or
>> StringIO in python)? If it absolutely has to be an integer that
>> refers to some OS-level resource, you could perhaps create a pipe for
>> that, using a second thread to read from the pipe.
>
> I asked this from some of our perl guys, they couldn't immediately
> think of a way how to get that FILEHANDLE to an array instead.
> And as the program isn't very long ~250 lines (quite compact though,
> probably will translate to 400-450 (more readable) python lines)),
> I'm more inclined to rewrite it in python than to do that thread-hack.

Looking at my handy camel book (Programming Perl, 2nd Edition), it looks
like you can get this to work through a couple of options (note: I
haven't tested any of these):

1) Use open's auto-forking powers, by opening "-|". Need to do some
work to handle the fork, but may be the safest route.
2) Use IPC::Open2 (standard library). There's a warning that your OS
may not support it, or may buffer the output in a way that'll give you a
headache. You'd need to test to see if it meets your needs, I guess.
3) Use Comm.pl, from CPAN. The book indicates that this handles buffers
better. However, I can't find any reference to it through "perl -e
shell -MCPAN", so I think my book's reference is out of date (go
figure).

In looking at CPAN's website to try to find that last one, I did find
this, which details the first option fairly clearly:

http://search.cpan.org/~nwclark/perl-5.8.8/pod/perlipc.pod#Bidirectional
_Communication_with_Yourself

Hope that helps,
-David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu May 18 15:05:43 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.