Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: check deleted .zwc files



> I have a .zwc file for several functions.  I update one of those functions.
> I then remove and rebuild the .zwc file.  Now, stat() of the .zwc shows
> that it is newer than the function file, but any running zsh still has a
> mapped descriptor on the removed file.  With this code:

> >      if (stat(filename, buf)) {
[...]

> zwcstat() will cause zsh to decide that it can keep using the mapped copy,
> even though the function file is actually newer than the mapped copy.

Maybe I'm confused.  If you've generated a new .zwc file, that stat()
will return 0, and the mapped copy won't even be considered.
 
> The only safe thing to do is to try the fstat() first, then stat().  To be
> really complete, if fstat() and stat() disagree zsh should throw out the
> mapped file and reload it, but that could get pretty tricky.

Too tricky for me.



Messages sorted by: Reverse Date, Date, Thread, Author