> Xiangli Zhang wrote:

<snip>

> 
> Aha, are you trying to open the vi editor? Then I don't think I'm able
> to help you; not sure if it's even possible to do that from a CGI script.
> 
> > main page"test.pl" [readonly] 6L,
> > 95C#!/usr/bin/perl -w print "Content-Type: text/html\n\n";
> > print "this is phrap testing file"; ~ ~ ~
> > ~ ~ ~ ~ ~ ~ ~
> > ~ ~ ~ ~ ~ ~ ~ 
> > Vim: Error reading input, exiting... Vim:
> > Finished.  Software error:
> > 
> > 'vi test.pl' failed: 256 at /var/www/cgi-bin/jun06_uploadFile.cgi
> > line 78.
> 
> Among all the funny characters, I notice [readonly]. Can it possibly
> be that you need to change the permissions for the file to make it
> editable by CGI?
> 
> But, to be honest, I don't think that's enough. Hopefully somebody
> else is willing to jump in and advise.
>

'vi' is a terminal based application, which is generally expecting to do
I/O on a terminal, or in a console/x window (in the case of gvim). 
Presumably you could manage a vi session with something like expect or
something, but that sounds like a nightmare.  Since 'vi' is just a file
editing app, and you are running over a stateless CGI session the normal
method would be to load a page with a form, drop the contents of the
file into a textarea and have that form submit back to a script that
stores the file.  Granted, then you can't use all the shortcuts and key
combos of Vi, but then you are doing this over a stateless connection
which has its benefits.  

What are you really trying to do...

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to