Thanks David<br><br><div class="gmail_quote">On Fri, Nov 25, 2011 at 9:50 AM, David Hamm <span dir="ltr"><<a href="mailto:ale@spinnerdog.com">ale@spinnerdog.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Oh, good point.. Sorry about that.<br>
<br>
I found this, on the php docs site in a user comment, after posting here.<br>
::shrug,<br>
<br>
<?php<br>
function readline_callback($ret)<br>
{<br>
global $prompt_answer, $prompt_finished;<br>
$prompt_answer = $ret;<br>
$prompt_finished = TRUE;<br>
readline_callback_handler_remove();<br>
}<br>
<br>
readline_callback_handler_install('Enter some text> ',<br>
'readline_callback');<br>
<br>
$prefill = 'foobar';<br>
for ($i = 0; $i < strlen($prefill); $i++)<br>
{<br>
readline_info('pending_input', substr($prefill, $i, 1));<br>
readline_callback_read_char();<br>
}<br>
<br>
$prompt_finished = FALSE;<br>
$prompt_answer = FALSE;<br>
while (!$prompt_finished)<br>
readline_callback_read_char();<br>
echo 'You wrote: ' . $prompt_answer . "\n";<br>
?><br>
<br>
On Thursday, November 17, 2011 08:42:04 pm Richard Bronosky wrote:<br>
> It's customary to share the solution so that you are a contributor to the<br>
> community, not just a consumer. Imagine how frustrating it will be when our<br>
> mailman archive turns up as a Google search result for some other person<br>
> having the same problem, and instead of finding the answer they just get<br>
> teased with the fact that you found it and didn't share.<br>
><br>
> On Nov 17, 2011 8:07 PM, "David Hamm" <<a href="mailto:ale@spinnerdog.com">ale@spinnerdog.com</a>> wrote:<br>
> > Never mind. I found what I needed.<br>
> ><br>
> > thanks<br>
> ><br>
> > On Thursday, November 17, 2011 04:07:41 pm David Hamm wrote:<br>
> > > Hi,<br>
> > ><br>
> > > In php-cli, I'm looking for a way to allow a terminal user to edit a<br>
> > > file name before saving it. The program should prompt the user like<br>
> > > this.<br>
> > ><br>
> > > Save file as: yourfile.txt<br>
> > ><br>
> > > And the user should be able to edit the name of the file.<br>
> > ><br>
> > > I've looked at readline() but readline doesn't let you set an<br>
> > > initial/default value. I've also tried to find a way to push the<br>
> > > default value into the keyboard buffer but no luck.<br>
> > ><br>
> > > Does anyone have any ideas?<br>
> > > _______________________________________________<br>
> > > Ale mailing list<br>
> > > <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
> > > <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> > > See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> > > <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
> ><br>
> > _______________________________________________<br>
> > Ale mailing list<br>
> > <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
> > <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> > See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> > <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>This Apt Has Super Cow Powers - <a href="http://sourcefreedom.com">http://sourcefreedom.com</a><br>