system() produces error.

From: Jamie Ruff (jjr183_at_adelphia.net)
Date: 07/13/04

  • Next message: Godzilla: "Re: system() produces error."
    Date: 13 Jul 2004 07:44:51 -0700
    
    

    I am having problems with making system calls on Windows under Cygwin
    that involve the use of redirection operators and pipes. For example,
    the line below will cat two files, but the next command will not
    append the first file to the end of the second as expected and issues
    the error "Can't spawn "cmd.exe": No such file or directory at line
    x". If I issue the append command manually on the command line, then
    it works fine.

    system("cat file1 file2"); # works fine
    system("cat file1 >> file2"); # where is cmd.exe?

    Since the first command works, I assume that the path to 'cmd.exe' is
    set correctly within the program as system always uses cmd.exe to run
    commands.

    If I use ``'s, then I do not get the error, but the command still does
    not execute.

    One possible explanation, is that since I am using Cygwin on Windows
    to allow the script to run UNIX style commands, Perl may be having
    problems with that. The question being how do I test for this?


  • Next message: Godzilla: "Re: system() produces error."

    Relevant Pages

    • Re: [TIN] Reading groups from active file
      ... "Primary DNS suffix of this computer:". ... do a "ipconfig /all" command (in a Command Prompt ... Windows utilities and the Windows "Command Prompt" window and its ... Cygwin - have 'set', ...
      (news.software.readers)
    • RE: re-setting boot partition
      ... Description of the Windows 2000 Recovery Console ... For a Microsoft Windows XP version of this article, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ...
      (microsoft.public.win2000.setup_upgrade)
    • RE: Win2000 Upgrade to SP3 Express Setup error.
      ... Start your computer with the Windows Setup floppy disks, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ... you cannot copy a file from the local hard disk to a floppy disk. ...
      (microsoft.public.win2000.setup_upgrade)
    • RE: Locating corrupt driver
      ... This article describes the functionality and limitations of the Windows ... Create and format partitions on drives. ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ...
      (microsoft.public.win2000.applications)
    • >>>> NET SEND <<<<
      ... Windows Xp Net Send ... Net Send Command For Mac ... Net Send Syntax Dos ... Dos Net Send Commands ...
      (sci.lang.japan)