Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

system perl api fails with exit code 65280 on Win 2003

by Prakash Babu (Initiate)
on May 22, 2013 at 14:02 UTC ( #1034752=perlquestion: print w/replies, xml ) Need Help??
Prakash Babu has asked for the wisdom of the Perl Monks concerning the following question:

I have perl script that is executed from a Application server using java on Windows 2003.

my $zipExec='C:/zip.exe'; my @cmd = ($zipExec, "-rq", $destinationPath, "."); print "Executing command @cmd\n"; $syscode = system(@cmd); my $error = $!; print "Return code = $syscode \n"; print "Error = $error\n";

It fails with the following error message.

Return code = 65280
Error = No such file or directory

I have ensured that C:/zip.exe files exists and is executable. I tried executing other system binaries like cmd.exe but ran into the same issue.
My question is what could be causing this issue like
i. some environment setting is wrong and interfering with the system api and hence it is not able to load the binary.
ii. The $PATH variable in this environment is greater than 1024 characters. Is the length of this variable a concern or some paths set in this variable is causing this issue


thanks,
Prakash

Replies are listed 'Best First'.
Re: system perl api fails with exit code 65280 on Win 2003
by BrowserUk (Pope) on May 22, 2013 at 14:18 UTC
    I have ensured that C:/zip.exe

    The system code simply means that the program did not run.

    The error code tells you that the command could not be found.

    The reason is that the command shell expects forward slashes (\) not backslashes (/) in paths.

    The reason is that the command shell expects backslashes (\) not forward slashes (/) in paths.

    Change  my $zipExec='C:/zip.exe'; to  my $zipExec='C:\\zip.exe'; and your command will probably work.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      «The reason is that the command shell expects forward slashes (\) not backslashes (/) in paths.»

      But BrowserUk: isn't \ backslash and / is forward slash?

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

        D'oh! karlgoethebier++ :)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

      I tried "/", "\", "\\" but hitting the same issue.

      thanks,
      Prakash

        Hm. What's in $destinationPath?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: system perl api fails with exit code 65280 on Win 2003
by karlgoethebier (Monsignor) on May 22, 2013 at 16:11 UTC

    Please see Maximum Path Length Limitation.

    BTW, what happens, if you put zip.exe in your PATH edit: (C:\full\path\to\zip.exe)?

    IMHO this should work (my $zipExec='zip.exe';) even if you schedule it. Hope i didn't miss something.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Re: system perl api fails with exit code 65280 on Win 2003
by Anonymous Monk on May 23, 2013 at 02:41 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1034752]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2019-03-19 02:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (89 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!