473,625 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fork() and exec() dont work

i m using Windows XP, and by tomorrow i will have have fedora core
installed too. the problem is, when i use these "fork() and exec()" my
windows doesnt do anything, python gives an error about the module,
the kind of error when u know u r wrong.

is it because these commands work on linux?

if so, is it better for me to stick with fedora for my python programs
or use windows?
--
* Posted with NewsLeecher v3.0 Beta 7
* http://www.newsleecher.com/?usenet
Nov 4 '05 #1
2 1861
"""
fork( )

Fork a child process. Return 0 in the child, the child's process id in
the parent. Availability: (!!!) Unix (!!!).
"""

Nov 4 '05 #2
blahman (bl**@blah.blah ) wrote:
i m using Windows XP, and by tomorrow i will have have fedora core
installed too. the problem is, when i use these "fork() and exec()" my
windows doesnt do anything, python gives an error about the module,
the kind of error when u know u r wrong.

is it because these commands work on linux?
as documentation says:

fork( )
Fork a child process. Return 0 in the child, the child's process id in the
parent. Availability: Macintosh, Unix.

if so, is it better for me to stick with fedora for my python programs
or use windows?


You can achive the same thing in windows by taking different approach,
but i would say that Linux is way more programmer-friendly (especially
Debian ;-)

--
Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl)
www.fiedzia.prv.pl

When tempted to fight fire with fire, remember that the Fire Department
usually uses water.
Nov 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5900
by: Benoit Dejean | last post by:
hello, i have a question about forking processes atm, i have some code which i want to rewrite os.system("cd ~ && exec " + cmd + " & disown") i want to remove this os.system call
3
2358
by: Lingyun Yang | last post by:
Hi, I want to use python as a "shell like" program, and execute an external program in it( such as mv, cp, tar, gnuplot) I tried: os.execv("/bin/bash",("/usr/bin/gnuplot",'-c "gnuplot < plot.tmp"')) since it's in a for-loop, it should be executed many times, but It exits after the first time running.
1
3458
by: Alexander N. Spitzer | last post by:
I am trying to write a program that will fork a process, and execute the given task... the catch is that if it runs too long, I want to clean it up. this seemed pretty straight forward with a single executable being run from the fork. The problem I am having now is that if I call a shell scripts, then lets say calls "xterm &", after the timeout has occurred, I kill the shell script, but the xterm is still running... I cannot seem to kill...
3
2712
by: thrillseekersforever | last post by:
The questions(A&B) are to fine no# of process running from the below codes. However, I couldn't decipher the solution. Will someone please throw some light on this? Thanks a lot!! A] void main() { .... pid1 = fork(); if (pid1) pid2 = fork(); .....
2
2793
by: Rafael Giannetti Viotti | last post by:
Hi, I am working with the subprocess.py module in Python 2.4.4 and I am confused about it's functionality. It uses the standard pipe-fork-exec method to start a subprocess: # create pipes pid = fork()
3
2200
by: Dan Upton | last post by:
I have a Python script that does a fork/exec, so the parent process can get the child's PID and monitor /proc/PID/stat (on a CentOS system). Most of my processes' command lines are straightforward enough to do this with, but I have a handful that use < on the command line, eg ../gobmk_base.linux_x86 --quiet --mode gtp < 13x13.tst The only thing I could really think of to try was
26
3640
by: warth33 | last post by:
Hello I have a php site. Some page needs to call an external program. The programs are home made c# applications. It uses to work without problem. For a while. Maybe it work for some hour. Or for a day. Or even for a week. At a certain point, when a php script calls the exe file, the application freezes. The following happens:
5
2509
by: Jatek | last post by:
Hi i have learned how fork.pl and exec.pl work as a starting point,but i want to create a program called shell.pl that will repeatedly read a line of user inpu until the user enters CTRL-D (end of file). For each line entered, the program should fork a process that will execute the provided command using exec. i want the parent process to use wait to await the completion of the child process. I want the program to handle invalid commands by...
5
3385
by: boddah | last post by:
Hi all, I'm writing a manager application (Linux/C++) that'll spawn 2 instances of a program (myApp). The myApp program needs to stay alive after being spawned (both instances) so a 3rd party program could connect to them thru socket. My problem is at the fork and exec function which I'm not really familiar with yet. Could anyone help to point me in the right direction or maybe enlighten me with the correct usage of fork and exec. Thanks and...
0
8189
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
8692
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...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8497
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
7182
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
6116
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...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1499
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.