Saturday, August 28, 2010

Re: Netrw and new file through ftp connection

Anyway, if g:netrw_ftp_cmd has -s:
> in it (or -S:), it will assume that its got login information like a
> .netrc.  I was able to avoid manual entry of the userid+password that
> way.

Hum, I have tested v141a with this line in my _vimrc
let g:netrw_ftp_cmd= "ftp -s:" . $home . "/.netrc ftpperso.free.fr"

Then e ftp://mypathtomyftpwebsite/

It seems like your script is reading .netrc containing all
informations but doesn't mind about password information => I am not
logged in.

This is the Decho log :
---------
Decho Tab C:\Users\Admin\vimfiles\autoload\netrw.vim
---------
doing autoload/netrw.vim version v141a
ssh is not executable
netrw#Nread(mode=2 fname<ftp://valentinnicolas@ftpperso.free.fr/>) {
|netrw#NetrwSavePosn() {
||currently, win#1 line#1 col#1
||netrw#NetrwRestorePosn() a:0=0 winnr=1 line=1 col=1 hline=1 {
|||restore window: exe silent! 1wincmd w
|||restore topofscreen: exe norm! 1G0z
|||restore posn: exe norm! 1G01|
|||return netrw#NetrwRestorePosn }
||return netrw#NetrwSavePosn : winnr=1 line=1 col=1 hline=1 }
|netrw#NetRead(mode=2,...) a:0=1 v141a {
||s:NetrwOptionSave(vt<w:>) win#1 buf#1<ftp:\
\valentinnicolas@ftpperso.free.fr\> winnr($)=1 {
|||w:netrw_optionsave doesn't exist
|||fo=tcq acd=0 diff=0
|||return s:NetrwOptionSave : win#1 buf#1 }
||s:NetrwSafeOptions() win#1 buf#1<ftp:\
\valentinnicolas@ftpperso.free.fr\> winnr($)=1 {
|||win#1's ft=
|||s:NetrwCursorline() liststyle=0 g:netrw_cursorline=1
s:netrw_usercuc=0 s:netrw_usercul=0 {
||||setlocal cursorline
||||return s:NetrwCursorline : l:cursorline=1 l:cursorcolumn=0 }
|||ft<> ei=
|||fo=nroql2 acd=0
|||return s:NetrwSafeOptions }
||s:RestoreCursorline() currently, cul=1 cuc=0 win#1 buf#1 {
|||return s:RestoreCursorline : restored cul=0 cuc=0 }
||readcmd<%r> ichoice=1
||s:GetTempfile(fname<>) {
|||tmpfile<C:\Users\Admin\AppData\Local\Temp\VIAFA55.tmp> : from
tempname()
|||tmpfile<C:/Users/Admin/AppData/Local/Temp/VIAFA55.tmp> : chgd any \
-> /
|||tmpfile<C:/Users/Admin/AppData/Local/Temp/VIAFA55.tmp>
s:netrw_tmpfile<C:/Users/Admin/AppData/Local/Temp/VIAFA55.tmp>
|||o/s dependent fixed tempname<C:\Users\Admin\AppData\Local\Temp
\VIAFA55.tmp>
|||ro=0 ma=1 mod=0 wrap=0
|||return s:GetTempfile <C:\Users\Admin\AppData\Local\Temp
\VIAFA55.tmp> }
||no lastfile: choice<ftp://valentinnicolas@ftpperso.free.fr/>
||choice<ftp://valentinnicolas@ftpperso.free.fr/>
||NetrwMethod(a:choice<ftp://valentinnicolas@ftpperso.free.fr/>) {
|||determine method:
|||ftp://...
|||g:netrw_machine<ftpperso.free.fr>
|||s:FileReadable(fname<C:\Users\Admin\.netrc>) {
||||return s:FileReadable 1 }
|||a:choice <ftp://valentinnicolas@ftpperso.free.fr/>
|||b:netrw_method <2>
|||g:netrw_machine<ftpperso.free.fr>
|||g:netrw_port <>
|||g:netrw_uid <valentinnicolas>
|||b:netrw_fname <>
|||return NetrwMethod : b:netrw_method=2 g:netrw_port= }
||s:GetTempfile(fname<>) {
|||tmpfile<C:\Users\Admin\AppData\Local\Temp\VIAFA55.tmp> re-using
|||ro=0 ma=1 mod=0 wrap=0
|||return s:GetTempfile <C:\Users\Admin\AppData\Local\Temp
\VIAFA55.tmp> }
||checking if NetrwBrowse() should handle choice<ftp://
valentinnicolas@ftpperso.free.fr/> with netrw_list_cmd<>
||yes, choice matches '^.*[/]$'
||s:NetrwBrowse(islocal=0 dirname<ftp://
valentinnicolas@ftpperso.free.fr/>) liststyle=0 v141a buf#1<ftp:\
\valentinnicolas@ftpperso.free.fr\> win#1 {
|||tab#1 win#1
|||redir<ls!>:
|||redir<ls!>: 1 %a "ftp:\\valentinnicolas@ftpperso.free.fr\"
ligne 1
|||redir<ls!>: 2u a- "Decho Tab" ligne 0
|||s:NetrwBookHistRead() {
||||sourcing .netrwhist
||||return s:NetrwBookHistRead }
|||s:NetrwOptionSave(vt<w:>) win#1 buf#1<ftp:\
\valentinnicolas@ftpperso.free.fr\> winnr($)=1 {
||||w:netrw_optionsave=1
||||return s:NetrwOptionSave : options already saved }
|||s:UseBufWinVars() {
||||return s:UseBufWinVars }
|||NetrwMenu(domenu=1) {
||||initialize menu
||||return NetrwMenu }
|||s:NetrwGetBuffer(islocal=0 dirname<ftp://
valentinnicolas@ftpperso.free.fr/>) liststyle=0 {
||||--re-use a buffer if possible--
||||--find buffer numnber of buffer named precisely the same as
dirname--
||||redir<ls!>:
||||redir<ls!>: 1 %a "ftp:\\valentinnicolas@ftpperso.free.fr\"
ligne 1
||||redir<ls!>: 2u a- "Decho Tab" ligne 0
|||| find buffer<ftp://valentinnicolas@ftpperso.free.fr/>'s number
|||| bufnr(dirname<ftp://valentinnicolas@ftpperso.free.fr/>)=1
|||| findbuf1: bufnum=bufnr('ftp://
valentinnicolas@ftpperso.free.fr/')=1 bufname(1)<ftp:\
\valentinnicolas@ftpperso.free.fr\> (initial)
|||| handling approx match: bufnum#1<ftp:\
\valentinnicolas@ftpperso.free.fr\> approx-dirname<ftp://
valentinnicolas@ftpperso.free.fr/>
|||| findbuf2: buflast=bufnr($)=2
|||| findbuf3: while [ibuf= 1]<=[buflast=2]: dirname<ftp://
valentinnicolas@ftpperso.free.fr/> bname=bufname(1)<ftp://
valentinnicolas@ftpperso.free.fr>
|||| findbuf3c: passes test 3 : dirname<ftp://
valentinnicolas@ftpperso.free.fr/>=~^ftp://
valentinnicolas@ftpperso.free.fr/$
|||| findbuf4: bufnum=1 (ibuf=1 buflast=2)
||||--re-use buffer#1 (bufexists([bufnum=1])=1)
|||| reusing buffer#1<ftp:\\valentinnicolas@ftpperso.free.fr\>
using: b 1
||||s:NetrwListSettings(islocal=0) {
|||||setlocal bt=nofile nobl ma nonu nowrap noro
|||||exe sil! keepalt file ftp:\\valentinnicolas@ftpperso.free.fr\
|||||redir<ls!>:
|||||redir<ls!>: 1u%a "ftp:\\valentinnicolas@ftpperso.free.fr\"
ligne 1
|||||redir<ls!>: 2u a- "Decho Tab" ligne 0
|||||exe setlocal ts=32
|||||return s:NetrwListSettings }
||||return s:NetrwGetBuffer 0 : re-using buffer#1, but its empty, so
refresh it }
|||2match none
|||set b:netrw_curdir to the new directory name: (buf#1)
|||b:netrw_curdir<ftp://valentinnicolas@ftpperso.free.fr/>
|||remote only:
|||b:netrw_curdir<ftp://valentinnicolas@ftpperso.free.fr/>
dirname<ftp://valentinnicolas@ftpperso.free.fr/>
|||(normal) dirname<ftp://valentinnicolas@ftpperso.free.fr/>
|||b:netrw_curdir<ftp://valentinnicolas@ftpperso.free.fr/> (remote)
|||s:BrowserMaps(islocal=0) b:netrw_curdir<ftp://
valentinnicolas@ftpperso.free.fr/> {
||||make remote maps
||||s:RemotePathAnalysis() {
|||||set up s:method <ftp>
|||||set up s:user <valentinnicolas@>
|||||set up s:machine<ftpperso.free.fr>
|||||set up s:port <>
|||||set up s:path <>
|||||set up s:fname <valentinnicolas@ftpperso.free.fr/>
|||||return s:RemotePathAnalysis }
||||s:SetRexDir(islocal=0 dirname<ftp://
valentinnicolas@ftpperso.free.fr/>) {
|||||return s:SetRexDir }
||||return s:BrowserMaps }
|||s:PerformListing(islocal=0) bufnr(%)=1<ftp:\
\valentinnicolas@ftpperso.free.fr\> {
||||s:NetrwSafeOptions() win#1 buf#1<ftp:\
\valentinnicolas@ftpperso.free.fr\> winnr($)=1 {
|||||win#1's ft=
|||||s:NetrwCursorline() liststyle=0 g:netrw_cursorline=1
s:netrw_usercuc=0 s:netrw_usercul=0 {
||||||setlocal cursorline
||||||return s:NetrwCursorline : l:cursorline=1 l:cursorcolumn=0 }
|||||ft<> ei=
|||||fo=nroql2 acd=0
|||||return s:NetrwSafeOptions }

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment