473,385 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Background running proces monitor

Hi

I am running a background command and want to mointor output of that commands which generate some flag files. When it finish it should be stopped.

I tried this
Expand|Select|Wrap|Line Numbers
  1. open(MON, "$CMD > output.txt |") || die "Can't start the $COMCOMM";
  2. while (<MON>) {
  3.    opendir(DIR, $dir) or die " Can't open $dir";
  4.     while ($file = readdir(DIR)) { 
  5.       if ($file eq "still_running_flag") {
  6.         print "$CMD is running...\n"; 
  7.         sleep 10;
  8.         next;
  9.       }
  10.     }
  11.    }
  12.  
The problem is it is not running in background.

Thanks
Feb 6 '08 #1
1 1503
KevinADC
4,059 Expert 2GB
add $! to the die call and see if it helps determine why the command fails:

Expand|Select|Wrap|Line Numbers
  1. die "Can't start the $CDM : $!";

Edit: I possibly did not understand your question/problem. The process will not run in the background, it will run right then when you open/pipe to it, not sure what you are trying to do.
Feb 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Alan Walkington | last post by:
Folks: How can I get an /exec'ed/ process to run in the background on an XP box? I have a monitor-like process which I am starting as 'exec("something.exe");' and, of course the exec function...
4
by: Reiner Block | last post by:
Hi, I installed eric3 and done the settings. But I don't like the white background and changed at Options/Editor/Sourcecode, language Python the background color and font. But it affects just...
2
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
0
by: Marian Dvorsky | last post by:
I would like to create an application that will be running in the background and will have an icon in the Notify bar in the lower-right corner of Windows desktop. For Windows NT+ I will probably...
4
by: Mrinal Kamboj | last post by:
Hi , Doubt may be bit trivial , but i wanted to know , what are the exact benefits derived while we run a background process as an NT service in windows , we can as well achieve the...
3
by: Zulander | last post by:
Hi, i have a DLL that i have made, I need the page to keep it running until the sesssion has ended. When the users logs in using webcontrol login, i create the object when the user has loged in...
4
by: Avadhoot | last post by:
Hi, I need to create a back ground thread in ASP.Net, but I want it be created only once. Here, let me explain. I have a web application project where the user uploads an excel file. On ce...
8
by: mtsweep | last post by:
Hi, I started a background thread to preform some time intensive tasks for a GUI frontend. This background thread uses a C++ object which requires a windows message loop so I started one in it...
1
by: ScottZ | last post by:
With python 2.6 and wxpython I'm trying to create a system tray icon application based around an example found here:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.