472,811 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

open pipe for system call does not work on windows

'Ello,

I'm writing a perl script to spawn child processes to execute jobs.
The jobs are system calls. I use open(SYSCALL, "cmd |), to make the
system calls because I need the pipe so I can log STDOUT to a file.
On Windows my script locks up after the first job is done. It works
fine on unix.

I am using fork to spawnt the child processes.

Any help is appreciated, or alternative suggestions is greatly
appreciated.

Thanks much.
Jul 19 '05 #1
4 10466
lu****@mediaone.net (Brian) wrote in message news:<96**************************@posting.google. com>...
'Ello,

I'm writing a perl script to spawn child processes to execute jobs.
The jobs are system calls. I use open(SYSCALL, "cmd |), to make the
system calls because I need the pipe so I can log STDOUT to a file.
On Windows my script locks up after the first job is done. It works
fine on unix.

I am using fork to spawnt the child processes.

Any help is appreciated, or alternative suggestions is greatly
appreciated.

Thanks much.


I use the following method and I get stdout back in a variable
NOTE quotes are back ticks (SHIFT Tilde )
$cmdString=`PRG_NAME PARMS`;

print $cmdString
Jul 19 '05 #2
Also, make sure you close when you're done. I've never really had any
issues, but from experience, I can tell you that if you fail to close()
you're eventually going to run into problems.

Also, make sure you're using a reasonabally modern (>= 5.6) perl on Windows.

w

Brian wrote:
'Ello,

I'm writing a perl script to spawn child processes to execute jobs.
The jobs are system calls. I use open(SYSCALL, "cmd |), to make the
system calls because I need the pipe so I can log STDOUT to a file.
On Windows my script locks up after the first job is done. It works
fine on unix.

I am using fork to spawnt the child processes.

Any help is appreciated, or alternative suggestions is greatly
appreciated.

Thanks much.

Jul 19 '05 #3
lu****@mediaone.net (Brian) wrote in message news:<96**************************@posting.google. com>...
'Ello,

I'm writing a perl script to spawn child processes to execute jobs.
The jobs are system calls. I use open(SYSCALL, "cmd |), to make the
system calls because I need the pipe so I can log STDOUT to a file.
No that is not necessary - you can re-open STDOUT to a file then just
use system().
On Windows my script locks up after the first job is done. It works
fine on unix.
ISTR this being a problem in 5.5 (or was it 5.4). Do you have really
anchient Perl? After all you seem to think this newsgroup still
exists and it hasn't existed for the same sort of time.
I am using fork to spawnt the child processes.


Oh, I thought you said you were using pipe-open.

fork() is not properly implemented by Windows. Avoid it.

Perhaps you should reduce your problem to a minimal but complete
script that illustrates the symptoms you are seeing and post it to a
newsgroup that still exists.
Jul 19 '05 #4
Thanks for all the comments.
Jul 19 '05 #5

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

Similar topics

2
by: Laszlo Barabas | last post by:
Hi, Until now I used the " FILE* popen(const char *, const char*)" to open one pipe and I got one "c style" file descriptor back. What I need is a similar system call to open a pipe, but...
10
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
0
by: olaf.dietsche | last post by:
Hi, The system is Windows XP and DB2 v8.1.7. I'm trying to load a text file via named pipe into a table. I have two programs: the first program creates the named pipe, waits for a client...
3
by: Karan | last post by:
I am calling finalize when form2 loads and deactivates form1 which closes form1. However, same thing is not happening in form2 because finalize is already called. Does anybody has solution to it....
2
by: Steve R. Hastings | last post by:
While studying iterators and generator expressions, I started wishing I had some tools for processing the values. I wanted to be able to chain together a set of functions, sort of like the...
10
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm building a technician's tool and I'm trying to create a Jump Panel of buttons to the Windows System32 folder to open files programmatically. I...
14
by: Rochester | last post by:
Hi, I just found out that the general open file mechanism doesn't work for named pipes (fifo). Say I wrote something like this and it simply hangs python: #!/usr/bin/python import os
6
by: sebastian.noack | last post by:
Hi, is there a way to or at least a reason why I can not use tarfile to create a gzip or bunzip2 compressed archive in the memory? You might might wanna answer "use StringIO" but this isn't...
3
by: Jeremy Sanders | last post by:
Hi - I have some code which works under linux. It starts a remote python process using subprocess and communicates to it via a pipe created by os.pipe. As far as I understand, child processes...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.