process

C#: How do I run a batch process after a program exits (not called during it).

I have the following setup: MainApp.exe checks for updates, downloads latest updates. The problem is that sometimes the updates are DLLs that the MainApp.exe is currently using. So, I thought maybe just dump all the files into an Update (temp) folder and when the program exits run a batch file that overwrites the DLLs and then relaunche...

Getting parent process / Restarting a process C#

I have a parent program that calls a worker console app when and update is found to update the files, this application gets the process ID from the parent via arguments and then calls WaitForExit(). What I wish to know is what would be the best way of then restarting that process, would simply calling Proc.Start() be the best way of doin...

Is it possible to "hang" a Linux box with a SCHED_FIFO process?

Hello, I want to have a real-time process take over my computer. :) I've been playing a bit with this. I created a process which is essentially a while (1) (never blocks nor yields the processor) and used schedtool to run it with SCHED_FIFO policy (also tried chrt). However, the process was letting other processes run as well. Then som...

Is there a way to find the second longest word in a sentence in Python ?

Hello everyone, I got stuck on this idea: how do I get the second longest word in a sentence ? I'm going to use it for an exit route in my code where the longest word might fail a test. Any ideas ? Thanks in advance. ...

How can I randomize this text generator even further ?

Hello everyone, I'm working on a random text generator -without using Markov chains- and currently it works without too many problems -actually generates a good amount of random sentences by my criteria but I want to make it even more accurate to prevent as many sentence repeats as possible-. Firstly, here is my code flow: 1-Enter a sen...

What is code to all procces name in iphone

I find this to kill process system("usr/bin/killall processName"); And i need know all process name in iphone at moment ...

How to set env variable and start a process in C

Can anybody please help me showing how to set an environment variable and start a process in ANSI C for Windows? If possible I want to avoid using any windows API for this. ...

The process cannot access the file because it is being used by another process.

I have a program I made in C that will restart my Java application after running for 2 hours. First of all, I run my java program using a batch file, @echo off java -server -Xmx1024m -Xbootclasspath/p:"bin;" website.Server >>C:\web_logs\console.log It works perfectly fine, but after the 2 hours is up I use Runtime.getRuntime(); in Ja...

VB.NET - Dimming an array of processes.

Trying to dim a certain amount of process (determined by Environment.ProcessorCount) to run several processes which do not support multi-threading. I have already Dim'd proinf(6) as Process.ProcessStartInfo because I have designed a queue for the processes and this encounters no errors. Any help is appreciated! ...

Invoking android apk from another apk

I tried invoking an android apk (AA1) from another apk (BB1) by raising intent. But BB1 starts starts AA1 in its own process space and it does not use the existing running process of AA1. How can I achieve a. I want BB1 to use existing AA1 if it is already running. b. If it is not already there, it should invoke AA1 as an independent ap...

Launch user mode process from Admin mode process

I have a win32 process running as admin mode. I cannot change the fact it's running in admin mode. I have an executable on my system which I'd like to launch from that admin process, but have it run in user mode. How do I achieve that? ...

Is there a way to forbid connection from outside of the local session in Windows ?

Let's consider I have a service in my user session that listens on some TCP port. Is there a way, on Windows, to only authorize processes from the same session to connect, and to deny connections from the "outside" ? ("outside" means another computer, and another user session on the same host). I will also accept any alternative to TCP...

Time of thread vs process in windows?

I need to chose between a process with 2 threads or a 2 processes with one thread on windows. I am intresting in the time slice. Windows running threads so context switch will be in either case. What I want to know if the time it runs each of the thread in the 2 cases will be the same? Thanks. ...

c/unix: abort process that runs for too long

I need to kill such user processes that are taking longer time than a said expected interval on UNIX (Solaris) operating system. This needs to be done inside the process that is currently being executed. Please suggest how this can be achieved in C or in UNIX? ...

AM kill proces and did not restart all services

Hi , we observed one scenario where activity manager killed our application process(it includes 5 running services) and then when it re-started the application process, it re-started only 1 service (this service was first one to be destroyed) . I/ActivityManager( 1660): No longer want com.android.bluetooth (pid 4961): hidden #16 I/Activ...

How to capture the standard output/error of a Process.start()?

How does one capture the standard output/error of a process started by a Process.start() to a string? ...

Start a process in the same console

Can I start a process (using C# Process.Start()) in the same console as the calling program? This way no new window will be created and standard input/output/error will be the same as the calling console application. I tried setting process.StartInfo.CreateNoWindow = true; but the process still starts in a new window (and immediately clo...

Determine runtime system for process execution from java program.

I am trying to call native executables from java program. I have three exe files one for win32, other linux 32-bint and third linux 64-bit, now before I can call the right executable I need to determine which platform program is running on. I can determind Operating system by simply getting "os.name" System property, but not sure how to ...

Java system.out vs new PrintStream

What would use more memory if it were to output a message that was 15,000 lines? Would System.out.println us more memory? or Would System.setErr(new PrintStream(new FileOutputStream("tonsoflines.log"))) use more memory? What uses more process or requires more memory to function? Visual output in a console window or writing to a file w...

Waiting for execvp in main

int main() { ... if(!fork()) { execvp(cmdName,cmdParam); } printf("In main()..."); return(0); } Assuming I have correctly passed the cmdName & cmdParam arguments, how do I wait for the process created by execvp to finish, before resuming the execution of main()? Does the execvp() create a proces...