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

RE: Problem with using system() on MS-Windows

Expand Messages
  • Yegappan Lakshmanan
    Hello Michael, ... Yes. This is exactly the problem. If an additional ( ) is added to the beginning and end of the command-line, then it works. Thanks,
    Message 1 of 3 , Oct 7, 2002
    • 0 Attachment
      Hello Michael,

      --- Michael Geddes <mgeddes@...> wrote:
      > Yup - I've seen the problem...
      >
      > Maybe this little snippit from cmd /? On winXP will help .. Especially
      > # 2..

      Yes. This is exactly the problem. If an additional (") is added to
      the beginning and end of the command-line, then it works.

      Thanks,
      Yegappan

      >
      > //.
      >
      > If /C or /K is specified, then the remainder of the command line after
      > the switch is processed as a command line, where the following logic is
      > used to process quote (") characters:
      >
      > 1. If all of the following conditions are met, then quote
      > characters
      > on the command line are preserved:
      >
      > - no /S switch
      > - exactly two quote characters
      > - no special characters between the two quote characters,
      > where special is one of: &<>()@^|
      > - there are one or more whitespace characters between the
      > the two quote characters
      > - the string between the two quote characters is the name
      > of an executable file.
      > 2. Otherwise, old behavior is to see if the first character is
      > a quote character and if so, strip the leading character and
      > remove the last quote character on the command line, preserving
      > any text after the last quote character.
      >
      >
      >
      > -----Original Message-----
      > From: Yegappan Lakshmanan [mailto:yegappan@...]
      > Sent: Tuesday, 8 October 2002 4:29 AM
      > To: vim-dev@...
      > Subject: Problem with using system() on MS-Windows
      >
      >
      > Hi all,
      >
      > I am using Vim 6.1 on a Windows 2000 system.
      >
      > When I use the following command:
      >
      > echo system('ctags' . ' -f - ' . '"c:\xxx\myfile.c"')
      >
      > the tag listing for the myfile.c file is listed.
      >
      > When I use the following command:
      >
      > echo system('"ctags"' . ' -f - ' . '"c:\xxx\myfile.c"')
      >
      > Note the quoting used for the ctags command. I am getting the following
      > error:
      >
      > The filename, directory name, or volume label syntax is incorrect.
      >
      > The above command line works when I run it from a command prompt.
      > Anybody else seeing this problem? I need to quote both the program
      > name and the argument file name to handle path names with space
      > characters.
      >
      > - Yegappan
      >
      >
      > __________________________________________________
      > Do you Yahoo!?
      > Faith Hill - Exclusive Performances, Videos & More
      > http://faith.yahoo.com


      __________________________________________________
      Do you Yahoo!?
      Faith Hill - Exclusive Performances, Videos & More
      http://faith.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.