On 8/9/06, Alexander 'boesi' Bösecke <[EMAIL PROTECTED]> wrote:
Hi
I'm using
let fn = input('Mainfile: ', expand('%:p'), 'file')
to ask for a filename. When I press Tab to complete the filename, a
"<space>"will be replaced by a "\<space>". So "G:\Projekte\CS
Simple\run.pyw" becomes "G:\Projekte\CS\ Simple\run.pyw". When I check
this filename with filereadable, it returns False. But when the filename
is "G:\Projekte\CS Simple\run.pyw" (ie. not using completion),
filereadable returns True.
Well I could modify the filename with
let fn = substitute(fn, "\\\\ ", " ", "g")
before calling filereadable. But I think this can not be the right way.
So where is the error - is it me, is it input or is it filereadable?
Looks like an input() bug to me. Confirmed in Linux for filenames
containing spaces:
:cd /tmp
:!touch "a b"
:let x=input("file->","","file")
Enter: 'a', space, 'b' , press Tab. Input turns into 'a\ b' and after
Enter, variable contains 4 chars 'a\ b'
Yakov