Re: Strange ENOENT error caused by vim.basic

2016-09-21 Fir de Conversatie gnd
Thank you, that sorted it out! I was expecting it will be sth of this
kind, and since i'm new to vim, didnt know where to search.

thanks again,

gnd/

On 09/21/2016 01:48 PM, James McCoy wrote:
> On Wed, Sep 21, 2016 at 02:19:04AM +0200, gnd wrote:
>> However i noticed there is some trouble with the way vim.basic handles
>> file writes as compared to vim.tiny. The application i am using for
>> live-coding, constantly checks a file for modifications, and if the file
>> was modified, renders it to screen. Everything works well using
>> vim.tiny, however after i started using vim.basic i noticed that i get
>> very often a EOENT error from the application, which sometimes results
>> in the code not being rendered.
> 
> vim.tiny runs with 'compatible' set, so 'backupcopy' is set to "yes".
> However, vim.basic runs with 'nocompatible' set, so 'backupcopy' is
> "auto".  It sounds like Vim is deciding that it can use the "no"
> behavior of 'backupcopy' in the situation where you encounter ENOENT.
> 
> When 'backupcopy' is effectively "no", the original file is renamed and
> a new file is written when you save a buffer, so there is a window where
> the original file name doesn't exist.
> 
> When 'backupcoy' is effectively "yes", a copy of the original file is
> made and the original is then overwritten, so the file path always
> exists.
> 
> Cheers,
> 

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Strange ENOENT error caused by vim.basic

2016-09-21 Fir de Conversatie James McCoy
On Wed, Sep 21, 2016 at 02:19:04AM +0200, gnd wrote:
> However i noticed there is some trouble with the way vim.basic handles
> file writes as compared to vim.tiny. The application i am using for
> live-coding, constantly checks a file for modifications, and if the file
> was modified, renders it to screen. Everything works well using
> vim.tiny, however after i started using vim.basic i noticed that i get
> very often a EOENT error from the application, which sometimes results
> in the code not being rendered.

vim.tiny runs with 'compatible' set, so 'backupcopy' is set to "yes".
However, vim.basic runs with 'nocompatible' set, so 'backupcopy' is
"auto".  It sounds like Vim is deciding that it can use the "no"
behavior of 'backupcopy' in the situation where you encounter ENOENT.

When 'backupcopy' is effectively "no", the original file is renamed and
a new file is written when you save a buffer, so there is a window where
the original file name doesn't exist.

When 'backupcoy' is effectively "yes", a copy of the original file is
made and the original is then overwritten, so the file path always
exists.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Strange ENOENT error caused by vim.basic

2016-09-21 Fir de Conversatie gnd
Hello,

I recently switched to vim.basic on Xubuntu 16.10. Apart from many
things i use it as a editing tool while doing live-coding performances.

However i noticed there is some trouble with the way vim.basic handles
file writes as compared to vim.tiny. The application i am using for
live-coding, constantly checks a file for modifications, and if the file
was modified, renders it to screen. Everything works well using
vim.tiny, however after i started using vim.basic i noticed that i get
very often a EOENT error from the application, which sometimes results
in the code not being rendered.

After many hours spent on this i realized it occurs only and only if i
use vim.basic for editing of the file. The application checks the file
modification time inside a infite loop using stat like this:

--snip--

struct stat sb;
if (stat(file_path, ) == -1) {
int errsv = errno;
if (errsv == ENOENT ){ printf("ENOENT: %s\r\n", file_path); }
return 1;
}
*out_mod_time = sb.st_mtime;

--snip--

Checking for all possible errnums i found the one returning is ENOENT
and put a printf to capture the file_path as seen above. What is
strange, whenever this happens i get a correct file_path from the
application:

ENOENT: shaders/tunnel.glsl

I wonder what might be the cause, and also what makes up the difference
between vim.tiny and vim.basic. I suppose it must be some special way of
writing the file to disk and modifying the st_mtime, that triggers my
error. Maybe i am doing the st_mtime check in a bad way.

I am using VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 16 2016
10:50:38) and checked this behavior on two machines with freshly
installed Xubuntu 16.10. It only happens when i edit the file with
vim.basic never with vim.tiny, or if i use sed to edit the file.

Maybe someone here can help me ? Im not sure if this is a bug, for me it
is, but it might also be my application.

thanks for any reply,

gnd/





-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.