handling

What's the cleanest way to fail gracefully when a file can't be opened in C++?

The program requires the file to run, but if for any myriad number of reasons it can't be found or isn't readable, etc - what's the cleanest way to fail out of the program? ...

Exception is NULL always

Hello all, Can someone explain to me why the Android "Catch" handler will not initialize an Exception object? When an error occurs and my code is trying to initialize an Exception object it is ALWAYS NULL. The above doesn't make sense to me because the exception should always initialize the Exception object period. It should never be n...

PHP server event handling

Hello. I am looking for a way to have like a button in a web page, only when you press it the event handling is a program in a server. Like a trigger to execute a program in the server. Is there any way to do this? Cumpz. ...

doubt in exception handling

I tried a simple code where user has to input a number. If user inputs a char it l produce numberformatexecption. That works fine. Now when i remove try catch block it shows error. What is the meaning of the error The code and error as follows import java.io.*; class execmain { public static void main(String[] args) { //...

File handling in core java

I need to do some housekeeping.I accidentally setup my classpath same as my codebase and all classes are placed along with my code.I need to write a quick java program to select all files of the type .class and .class alone and delete it immediately.Has anyone done something related to this? ...

Keyboard signal handling, adding parameters to callback handler function (Ubuntu, intel)

I have this code: #include <stdio.h> #include <stdlib.h> #include <signal.h> // Define the function to be called when ctrl-c (SIGINT) signal is sent to process void signal_callback_handler(int signum) { printf("Caught signal %d\n",signum); // Cleanup and close up stuff here // Terminate program exit(signum); } int main() ...