> 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[m[m[0m[H[2J[24;1H"test.pl" [readonly] 6L, > > 95C[1;1H#!/usr/bin/perl -w print "Content-Type: text/html\n\n"; > > print "this is phrap testing file"; [1m[34m~ [8;1H~ [9;1H~ > > [10;1H~ [11;1H~ [12;1H~ [13;1H~ [14;1H~ [15;1H~ [16;1H~ > > [17;1H~ [18;1H~ [19;1H~ [20;1H~ [21;1H~ [22;1H~ [23;1H~ > > [1;1H[24;1H[0mVim: Error reading input, exiting... Vim: > > Finished. [24;1H 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>