On 2010-08-11, Charles Campbell wrote:
> Gary Johnson wrote:
> >I just installed Vim 7.3e BETA from the Cream site and I think I've
> >found a bug in netrw.
> >
> >I start gvim by double-clicking the Vim icon on my desktop.  Then I
> >execute
> >
> >     :e sftp://[email protected]/.vimrc
> >
> >A command window pops up containing
> >
> >     C:\WINDOWS\system32\cmd.exe /c sftp "[email protected]:.vimrc" 
> >     C:\DOCUME~1\USERNA~1\LOCALS~1\Temp\VIA12.vimrc
> >     Connecting to server.com...
> >     [email protected]'s password:
> >
> >When I enter my password, the following appears in that same command
> >window.
> >
> >     Fetching /xc/u/g/username/.vimrc to
> >     C:DOCUME~1USERNA~1LOCALS~1TempVIA12.vimrc
> >     Couldn't open local file "C:DOCUME~1USERNA~1LOCALS~1TempVIA12.vimrc"
> >     for writing
> >     : No such file or directory
> >     shell returned 1
> >     Hit any key to close this window...
> >
> >Vim's buffer is empty.
> >
> >In addition to that, I see two potential problems.  One is that
> >there are no backslashes between directories in the error message.
> >Another is that netrw is apparently trying to put the temporary file
> >in a path containing the remote user's name rather than the local
> >user's name.
> >
> >I am running this on a Windows XP machine.  The "username" on the
> >remote system is different from my Windows user name.  I also have
> >7.3f BETA which I compiled for Cygwin on the same machine and the
> >same :e command works fine on the Cygwin version.  I am using the
> >versions of netrw that came with the Vim 7.3 installations.
> >
> >   
> 
> Check over your settings for the following; make sure that you can 
> submit commands with them (:! dir):

":! dir" works fine.

> "  set shell : name of shell to use for ! and :! commands

    shell=C:\WINDOWS\system32\cmd.exe

> "  set shq   : shellquote   -- how to quote characters about the cmd 
> passed to shell

    shellquote=

> "  set sxq   : shellxquote  -- includes redirection (shellquote excludes 
> that)

    shellxquote=

> "  set ssl   : shellslash   -- when set, forward slash used to expand 
> file names

    noshellslash

> "  set shcf  : shellcmdflag -- flag passed to shell to execute ! and :! 
> commands

    shellcmdflag=/c

> "  set sp    : shellpipe    -- string used to put output of :make into 
> errorfile

    shellpipe=>%s 2>&1

> "  set srr   : shellredir   -- string used to put output of filter cmd 
> into temporary file

    shellredir=>%s 2>&1

Putting ":verbose" in front of each of those confirms that they have
not been changed from their default values.

> Cygwin provides a more-unix-like environment; the settings you have that 
> run with it aren't likely to be the ones you need for windows.

I share my ~/_vimrc and ~/vimfiles between Windows and Cygwin Vims,
with appropriate changes to the settings in ~/.vimrc as needed.

I think I found the problem.  When I started gvim from a command
prompt as "gvim -N -u NORC" and tried editing the remote file, I got
an error message in the resulting command window saying, "'sftp' is
not recognized as an internal or external command, operable program
or batch file."  I restarted gvim as just "gvim" and found that it
was using the Cygwin sftp, which doesn't understand Windows-style
paths.

> What is your $HOME?

    C:\Documents and Settings\Gary Johnson

(I know, if I had thought about the implications of including a
space in my user name when I set up this Windows machine, I would
not have done that.)

> What does  :call tempname()  show?

:echo tempname() shows

    C:\DOCUME~1\GARYJO~1\LOCALS~1\Temp\VIB18.tmp

I can cd to that directory from the command prompt, so "GARYJO~1" is
apparently the short form of "Gary Johnson".  "GARYJO" also happens
to be the first 6 characters of my remote user name.

> Can you run a debugging trace?   (see  :help netrw-debug)

I did not try that since I think I found the problem.  Thanks for
your help and sorry to have wasted your time.  I was trying to
exercise the latest Vim beta on Windows, but I think I'll stick to
the Cygwin version for remote file editing rather than try to find a
Windows version of sftp.

Regards,
Gary

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui