473,387 Members | 3,033 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,387 software developers and data experts.

Trying to use cscope via pipes

Hi all,

I'm currently trying to put together a small script to talk to cscope
(http://cscope.sf.net/) via pipes. The obvious way to do this is via
popen2 (or popen4).

I've tried both the one in the os module and the one in the popen2
module, and I get the same effect with both - I don't get any response
on the stdout pipe until I've closed the stdin pipe, even if I call
flush().

What I'm trying to do should be possible, I think - cscope says that
it supports a line-oriented interface for this kind of thing, and the
cbrowser tool (written in tcl) uses cscope as a backend via pipes. So
the conclusion is that I'm missing something, but I can't quite work
out what... any ideas?

Script:

==
from os import popen2

handles = popen2("cscope -d -l")
writer = handles[0]
reader = handles[1]

writer.writelines("2bigphysarea_alloc_pages\n")
writer.flush()
#without closing it'll just hang... strange.
#writer.close()
lines = reader.readlines()
print lines
==

I'm using the following Python, since there aren't Python 2.3 RPMs
until Fedora C2 (and this is a work machine which I shouldn't update
too much):

Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2

Thanks,

Paul
Jul 18 '05 #1
1 1781
I wrote:
the conclusion is that I'm missing something, but I can't quite work
out what... any ideas?


Never mind - it was made clear by Donn Cave in
<do************************@gnus01.u.washington.ed u>.

Next time I shall attempt to engage brain before asking.

Thanks,

Paul
Jul 18 '05 #2

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

Similar topics

0
by: Christian Hammers | last post by:
Hello I would like to call a unix shellscript from within a PHP script and - write data to its STDIN - read data from its STDOUT *and* STDERR - get its exit code afterwards proc_open seems...
5
by: glenn.owens | last post by:
In the process of doing some routine monitoring/clean-up we've discovered that several (many?) users are apparently set to access our SQL Server 2000 database instances via the Named Pipes...
2
by: Rudolf Bargholz | last post by:
Hi, DB2 7.1 FP11 Windows 2000 Earlier this evening, after dropping and recreating a trigger, DB2 locked up. I am not entirely sure that the cause of the problem was the replacing of the...
9
by: Hans J?rg Brinksmeyer | last post by:
Hi, does anyone have an idea for this problem: I use anonymous pipes to steer a console program under Win2000 with a second 'steering aplication'. The stdin and output are redirected to...
0
by: Roland Puntaier | last post by:
""" Sometimes it is nice to have the data used by cscope accessible in a programatic way. The following python script extract the "functions called" information from cscope (function: callGraph)...
4
by: =?Utf-8?B?UmljaGFyZEBub3NwYW0ubm9zcGFt?= | last post by:
I'm trying to declare CreateFile as an extern from the dll like so: .... using System.Runtime.InteropServices; internal static extern IntPtr CreateFile( String filename, UInt32...
1
by: Evan | last post by:
Hi, guys ~~ How can i work on VIM for python code? I use cscope plugin on VIM for C code before, it helps me to different function and search C variable where it is defined. I'm now...
3
by: ZhukovL | last post by:
I'm having some trouble implementing the handling of multiple pipes in a shell I'm writing. I was hoping someone could point me in the right direction because I really cant see where I'm going...
2
by: Nathan | last post by:
Hey, IMO Eclipse is the best C IDE available on Linux. However, the CDT indexer keeps running out of memory (our product has several thousand source files and several million LOC. It may also be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.