473,807 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Background running proces monitor

1 New Member
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 1522
KevinADC
4,059 Recognized Expert Specialist
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
18545
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 blocks until something.exe terminates. Just what I /don't/ want. (Wouldn't an & be nice here! Sigh) I need something.exe to disconnect and run in the background while I
4
1486
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 the source text in the editor. After the end of the text in each line is still the white background. But I found no possibility to change that. Does I am blind or is it really not possible?
2
10482
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 have the same name and reside in the following physical path structure:
0
1769
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 have to create a windows service and some small program, something like service manager that will monitor that service, will be executed after user logon and will show an icon in a notify bar. Important is, that I would like to run my application as...
4
2387
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 functionality using standalone exe , which will keep on running in a loop and do the job till been messaged to stop . Essentially , i want the key advantages of implementing process daemons as an NT Service in windows .
3
1046
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 but for some reason the object closes and does not keep running, i know it starts up but it stop's for some reason !! Partial Class Login
4
1587
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 the file is uploaded and stored on the server, I need to create a thread which runs in the background and when notified, should open the excel file
8
12100
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 by calling Application.Run(). Now I can see that messages from the C++ libraries are being processed. But how do I send my own messages to this thread from the GUI frontend? I tried to use delegates/events/etc but it ends up either spawning a...
1
72565
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: http://codeboje.de/MailSneaker-Part-3-SystemTrayTaskBar-Icons-with-Python-and-wxPython/ The application will simply change the systray icon based on if an ip address is online or not. The ping portion looks like this: if os.name == "nt": # Windows
0
9720
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9599
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10626
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10112
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.