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

Re: How zcompile work?



You can trace the system calls using strace.

  strace zsh >/dev/null | grep zshrc

Look out for the "open" and "stat" system calls. If zsh uses the compiled .zwc 
it will look like this:

  stat("/home/joke/.zshrc.zwc", {st_mode=S_IFREG|0444, st_size=9624, ...}) = 0
  stat("/home/joke/.zshrc", {st_mode=S_IFREG|0640, st_size=3477, ...}) = 0
  open("/home/joke/.zshrc.zwc", O_RDONLY) = 3

zsh uses "stat" to check the modification time of .zshrc and .zshrc.zwc and 
decides to open .zshrc.zwc.


If the .zshrc is more recent then .zshwc zsh opens the .zshrc file:

  stat("/home/joke/.zshrc.zwc", {st_mode=S_IFREG|0444, st_size=9624, ...}) = 0
  stat("/home/joke/.zshrc", {st_mode=S_IFREG|0640, st_size=3477, ...}) = 0
  open("/home/joke/.zshrc", O_RDONLY|O_NOCTTY) = 3


On Friday 12 February 2010 14:51:49 Piotr Karbowski wrote:
> Hi there!
> 
> I am trying to understand how zcompile work. When I do zcompile .zshrc
> it making .zshrc.zwc  (3x bigger than .zshrc). How can I check if zsh
> really using compiled zshrc? And, when I changing zshrc but dont
> recompile .zwc, how it detect that zwc is outdatted? Sorry if I asking
> about something documented but I didnt found anything useful about it
> on google.
> 

Attachment: signature.asc
Description: This is a digitally signed message part.



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