exit-code

What is an appropriate way to programmatically exit an application?

I am evaluating user inputs as commands for my application. If the user presses Q, or q, and then hits enter, the application quits and execution terminates. Is there a proper context, or best practices on how to do that? I do not have any resources to release, or anything like that. Should I just use System.exit(0);? Is there a recomm...

How Do I Show A Final Form On Exiting In Delphi?

This should be a simple one for someone. I just can't figure out how to do it. Upon exiting of my program, I want to hide the main form and make a final "Thank You" form appear on its own, like this: procedure TMainForm.ExitExecute(Sender: TObject); begin MainForm.Visible := false; ThankYouForm.Show; MainForm.Close; end; But wh...

GetExitCodeProcess process termination status codes?

Does anybody know where can I find a list of GetExitCodeProcess' process termination status codes? I've done some search in the internet and haven't been able to find one. I'm receiving a 33102 code from a GetExitCodeProcess call and I don't understand why. I hope getting a description for this error code will help me sorting this out. ...

Execute process conditionally in Windows PowerShell (e.g. the && and || operators in Bash)

I'm wondering if anybody knows of a way to conditionally execute a program depending on the exit success/failure of the previous program. Is there any way for me to execute a program2 immediately after program1 if program1 exits successfully without testing the LASTEXITCODE variable? I tried the -band and -and operators to no avail, th...

How do I check the exit code of a command executed by flock?

Greetings all. I'm setting up a cron job to execute a bash script, and I'm worried that the next one may start before the previous one ends. A little googling reveals that a popular way to address this is the flock command, used in the following manner: flock -n lockfile myscript.sh if [ $? -eq 1 ]; then echo "Previous script is s...

Why would waitpid in Perl return wrong exit code?

I get wrong exit code from waitpid and I can't figure out why. Could someone give me some ideas? Here what I do: I start my child process with open2 then I wait for it to finish with waitpid get exit code using $? It always returns with -1 no mater what I return from child process. I check with VS debugger that my program returns an...

How can I set the exit code in Inno Setup?

I want to set the exit code for my installation, this way I will know why the installation was aborted. I'm using Inno Setup. ...

Automatically run a program if another program returns an error

I have a program (grabface) that takes a picture of the face of a person using a webcam, and I also have a shell script wrapper that works like this: On the command line the user gives the script the name of a program to run and its command line arguments. The script then executes the given command and checks the exit code. If there was...

What is the cause of JVM exit code 1073807364?

I've built a RCP-based application, and one of my users running on Windows XP, Sun JVM 1.6.0_12 had a full application crash. After the app was running for two days (and this is not a new version or anything), he got the nice gray JVM force exit box, with exit code=1073807364. He was away from the machine at the time, and the only thin...

How do I execute an external script while capturing both output and exit code in Perl?

I'm trying to check for an SVN tag existence from a Perl script. So I try calling svn info $url, read exit code and suppress standard output and standard error streams. However, I struggle to do this elegantly (there are probably better ways to ask SVN about a tag, but that's not the point here): my $output = `svn info $url/tags/$tag`; ...

convention to represent the exit status and actual result in XMLRPC

in the C world, a function can return error code to represent the exit status, and use INOUT/OUT parameter to carry the actual fruit of the process. when it comes to xmlrpc, no INOUT/OUT parameter, is there any best practice/conventions to represent the exit status and actual result? the context is i am trying to write an agent/daemon ...

SQL*Plus : Force it to return an error code.

Hi, I have a stored procedure that has an OUT parameter, indicating an error code. If the error code is not 0, then I raise an error DECLARE BEGIN foo (err_code); IF (err_code <> 0) THEN raise_application_error(...); END; So far so good, but here's my question. This piece of code (shown above) is executed by sqlplus, which is...

What does the status code of the perl interpreter mean?

I'm trying to execute a copy of the Perl interpreter using Java's Runtime.exec(). However, it returned error code 9. After running the file a few times, the perl interpreter mysteriously started to return code 253 with no changes in my command at all. What does code 253 / code 9 mean? A Google search for perl interpreter's exit codes tu...

Exit code of a process terminated with Process.Kill() , in C#

If in my C# application, I am creating a child process that can either terminate normally, or start misbehaving, in which case I terminate it with a call to Process.Kill().However, I would like to know if the process has exited normally.I know I can get the error code of a terminated process, but what would be a normal exit code and what...

Is it possible to get the exit code from a subshell?

Let's imagine I have a bash script, where I call this: bash -c "some_command" do something with code of some_command here Is it possible to obtain the code of some_command? I'm not executing some_command directly in the shell running the script because I don't want to alter it's environment. ...

Setting exit status when creating core dump

For example calling exit(100) would exit the application with status 100, and calling raise(SIGABRT) aborts the application with status 134 while creating a core dump. But what if I want the core dump with status 100 or any other arbitrary value. How can I do that ? I know there are several signals that triggers a core dump, but they see...

How to quit a java app from within the program

What's the best way to quit a Java application with code? ...

Return code/ exit code for Oracle's DataPump API

I wrapped oracle's IMPDP and EXPDP in a console and could not find a good place for the return codes that these two return. I want to be more specific in pointing out errors than just a 0/1 Pass/Fail. ...

Program exit code -SomeNumber

i made a program using Qt for Symbian, its all working very well ... However, it always exits with a status code -10737something when i close the program i think the problem is in the deconstructer, maybe some memory leaks ... any suggestion on how to solve this problem, or to find the error using Qt Creator? thanks ...

Capturing exit status from STDIN in Perl

I have a perl script that is run with a command like this: /path/to/binary/executable | /path/to/perl/script.pl The script does useful things to the output for the binary file, then exits once STDIN runs out (<> returns undef). This is all well and good, except if the binary exits with a non-zero code. From the script's POV, it thin...