Loading ...
Sorry, an error occurred while loading the content.

Re: Win32 challenge:

Expand Messages
  • Bram Moolenaar
    ... It s not a generic solution for executable(). We could add a findexecutable() function that does return the path. But it s not much help in general. --
    Message 1 of 5 , Mar 31, 2006
    • 0 Attachment
      Yakov Lerner wrote:

      > On 3/31/06, Bram Moolenaar <Bram@...> wrote:
      > >
      > > The executable() function checks if its argument is an executable
      > > program. This is used to check if the "xxd" command is in the path
      > > ($PATH). If it is then it is executed with ":!xxd", thus using 'shell'
      > > to execute the xxd program.
      > >
      > > You would expect this to work, but there is one catch: For Win32 Vim uses
      > > the SearchPath() library function to check if an executable can be
      > > found. This also checks the system directory, windows directory and the
      > > directory where the application was started. That last one is a
      > > problem: When the shell is invoked to execute the program it won't be in
      > > this directory. We can't change to the directory either, because the
      > > arguments to the shell command would be wrong.
      >
      > > I could re-implement SearchPath() to do the same but skip the directory
      > > in which Vim was started. Quite complicated. Is there another way
      > > perhaps?
      >
      > Is it an option to pass to the subshell the full pathname of xxd
      > (X:/path/to/xxd.exe)
      > as obtained from SearchPath(), instead of just xxd ?
      > Would not it solve the problem if subshell is given the full
      > pathname of xxd ?

      It's not a generic solution for executable().

      We could add a findexecutable() function that does return the path. But
      it's not much help in general.

      --
      ARTHUR: If you do not open these doors, we will take this castle by force ...
      [A bucket of slops land on ARTHUR. He tries to retain his dignity.]
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://www.ICCF.nl ///
    Your message has been successfully submitted and would be delivered to recipients shortly.