processes

How to keep a process running on a remote windows server

I need to implement a background process that runs on a remote windows server 24/7. My development environment is C#/ASP.NET 3.5. The purpose of the process is to: Send reminder e-mails to employees and customers at appropriate times (say 5:00PM on the day before a job is scheduled) Query and save GPS coordinates of employees w...

Terminating a process created using spawnv

Hi everyone, I'm not experienced with processes at all, but what I'm set to to should be really simple. All I do is spawn a process like this: int spawnId = spawnv(_P_NOWAIT,"wgetlocal.exe",my_env); Now, what I want to do is kill this program after a certain time. However, the returned spawnId is not what I need when for instance call...

When should I use each of Android's different messaging types?

Hi, I've been working with Android for well over a year now, but I still have trouble determining when different types of messaging/communication between processes/threads should be used. I'm mainly talking about broadcasting Intents, using AIDL for services, using Handlers to send messages and socket communication. Many of these tools...

Throwing exceptions from a Process.Exited handler

I have a program which runs an external, command line utility and reads the standard output (a PNG image.) Originally during testing, I had the command line program write the image to a temporary file, and then loaded the file into the program. I had a handler for Process.Exited which threw an exception if the exit code was nonzero. I ...

ProcessStartInfo print verb does not exist for .tif images

We have a piece of software that attempts to print .tif images using a ProcessStartInfo object. It sets the Verb property to "print" and the FileName property to the path of the image. It then sets the UseShellExecute property to true and executes the Process.Start() method. However, nothing happens. I created a small test program to...

Changing the process parent of a process to explorer.exe

I'm using CreateProcess to exec Notepad.exe, but the process parent of notepad is my own AP. When I closed my own AP, the process parent of notepad became to explorer. How would I do to put explorer as process parent for this new opened process? ...

Why is ioctl() not blocking?

I have written code for passing file descriptors between unrelated processes using streams. The server should wait for the client to send a file descriptor. Here is the server code: #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stropts.h> #include <stdio.h> #include <errno.h> #include <unistd.h> ...

Is there a System event when processes are created?

Is there any event when a new process is created. I'm writing a c# application that checks for certain processes, but I don't want to write an infinite loop to iterate through all known processes continuously. Instead, I rather check each process that is created or iterate through all current processes triggered by an event. Any sugge...

How do I reliably track child/grandchild processes on a POSIX system?

I have an interesting (at least to me) problem: I can't manage to find a way to reliably and portably get information on grandchildren processes in certain cases. I have an application, AllTray, that I am trying to get to work in certain strange cases where its subprocess spawns a child and then dies. AllTray's job is essentially to d...

Check if process user is an administrator c++

I want to get the process's user name and check if it is a local administrator . Or check directly if the current procees user is a local administrator ...

How to transfer sensitive data between processes in Windows?

I would like to transfer user name and password information from one process to another process running on the same server in Windows. What is the best approach to achieve this transfer in a secure way? One simple approach is to copy the passwords to a file and then have the other process read from a file and then delete the file once it...

C++ system function hangs application

I have the following code void reportResults() { wstring env(_wgetenv(L"ProgramFiles")); env += L"\Internet Explorer\iexplore.exe"; wstringstream url; url << "\"\"" << env.c_str() << "\" http://yahoo.com\""; wchar_t arg[BUFSIZE]; url.get(arg, BUFSIZE); wcout << arg << endl; _wsystem(arg); } Where...

How to find all child processes?

In a Linux-based project that I am working on, I need to be able to find all of my child processes. It is not feasible to record every time one is started -- they need to be found after the fact. This needs to be pure C, and I'd like to do it without reading /proc. Does anyone know how to do this? ...

Sandboxing in Linux

I want to create a Web app which would allow the user to upload some C code, and see the results of its execution (the code would be compiled on the server). The users are untrusted, which obviously has some huge security implications. So I need to create some kind of sandbox for the apps. At the most basic level, I'd like to restrict a...

Blank process name for OSX Cocoa application?

I'm developing an OSX application (Clarke) that runs with LSUIElement set (system menu only - no tray icon, doesn't appear in cmd-tab). It works totally fine, but someone just pointed out that it has a blank process name in the Activity Monitor listing. Just says nothing. Everything else in there has a name. Even other apps running at L...

How to check if a file has been opened by another application in C++

I know, that there's the is_open() function in C++, but I want one program to check if a file hasn't been opened by another application - is there any way to do it using standard library? EDIT - Clarified in the answers that this is for a Linux application. ...

How can I set the process-name for a Java-program?

If a Java-program is started, it get's in the system process-monitor the name java. Many Java-programs are that way hard to distinguish. So it would be nice, if a way exists, to set the name, that will be shown in the process-monitor. I'm aware that this may work different on different operating-systems. A simple way would be, if the j...

C++ Process Management

Is there a well known, portable, good library for c++ process management? I found a promising library called Boost.Process (http://www.netbsd.org/~jmmv/process/) but it's only a candidate for inclusion in the Boost library. Has anyone use this? Does anyone know why it isn't a part of Boost? Thanks! ...

Returning data from forked processes

If I do Process.fork do x end how can I know what x returned ? (e.g. true/fase/string) ? (writing to a file/database is not an option...) ...

I need some help using Threads in C#

Hello. I´m developing a software in C# that uses static functions from a C++ .dll file through a Wrapper. The problem is that some of these functions are slow and unstable, so in order to solve this I created a Thread that executes them. However, when I abort that thread from the main thread, the program isn´t letting me use those fun...