ven, 19 Mar 2010, epanda skribis: > I have modified the commands like that in order to take the good > targetfile > " Test Two > let cmd1 = '!start cmd /c "cppCheck ' . a:dir . ' -a -- > enable=all --template gcc 1> c:/infos.txt 2> cppcheck.out' > let cmd2 = '!start cmd /c "vim --servername ' . v:servername . > ' --remote-expr "GetAsyncText('."'c:\infos.txt'". ')"' > exec ' ' . cmd1 > exec ' ' . cmd2 > But..... it seems that my GetAsyncText func is not reading file like > I > want : > function! GetAsyncText(temp_file_name) > echo "hello world" > for line in readfile(temp_file_name,'',-1) > echo "HELLO" > endfor > endfunction > I would like that my GetAsyncText(temp_file_name) read continuously > the last line of file 'c:\infos.txt' in order to display it in > status > line. > But I don't see HELLO, just hello world. > Don't understand.... >
I suppose it is a race condition that cmd1 was spawned without waiting it doing any real work, control immediately returned to vim and cmd2 was then spawned before 'infos.txt' was written. You may try adding a sleep of sufficient long time before reading, or use some other synchronization scheme. - untest -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 -- 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 To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.