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

need help with enhancement to prevent completion from stat'ing automounts



Hi,

I am finally getting back to an issue I posted about back in January.
I am trying to use the fake-files zstyle to configure several hundred
automounts under /net and /home.  This mostly works, until zsh decides
to stat them all in order to decide which suffix to use for
completion.  What's happening is something like this:

1. _path_files calls compfiles passing in the fake-files zstyle data.
2. by the time compfiles returns, all memory of which values in the
   result were "fake" has been lost.
3. eventually _path_files calls compadd with the '-f' argument and the
   completions, meaning that compadd will stat all the values to
   figure out which are directories and which are files, in order to
   add the correct suffix.
4. compadd stats the fake automount points, causing the automounter to
   potentially mount hundreds of locations (already not good), and
   hang for a very long while timing out on a few tens that no longer
   exist that our ops department has not cleaned up.

I would like to create some configuration (via zstyle or whatever) to
prevent zsh from stat'ing these locations, and just assume they are
directories.  I was able to hard-code some logic in the ztat()
function in compresult.c which does exactly this for /net/* and
/home/*, and it works perfectly.

Now I just need some help to figure out what a reasonable way to
create a general configuration to support this would be.

thanks,
Greg



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