473,626 Members | 3,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.writelin es("2bigphysare a_alloc_pages\n ")
writer.flush()
#without closing it'll just hang... strange.
#writer.close()
lines = reader.readline s()
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 1785
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************ ************@gn us01.u.washingt on.edu>.

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
2285
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 to be the right thing to use but I have the problem that the called program gives >8kb data on both stdout/stderr back which causes my PHP script to simply hang in the fread call. To be precise the first 4096 "O" characters are read and displayed. ...
5
18125
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 protocol. In readings and recommendations we've decided that our WAN would be best served if we use the less "chatty" TCP/IP. As such we've also decided to try to enforce this decision to use TCP/IP exclusively using the domain login script used by all...
2
2702
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 trigger, but all of a sudden no users were able to connect to our customers database. After running db2dart I found numerous corrupted indexes which I removed using "db2dart MYDB /IM". Finally I was able to get a
9
2547
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 pipes. The console application has several fgets() and fgetc() to read strings and chars. This works very fine with the pipes.
0
2307
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) and produced an html file from them. from csCallGraph import * acg=callGraph(entryFun,workingDir)
4
7606
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 desiredAccess, UInt32 shareMode,
1
6742
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 starting to learn python, and I'd like to know how works on VIM. I saw that the VIM is support python such as syntax highlighting,
3
15978
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 wrong. Its supposed to work as follows: main shell forks off a child shell, the child shell sets up the pipes and forks off n-1 other shells (where n is the total number of commands). Each child shell sets its pipe file descriptors then execs to...
2
6093
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 due to symlinks causing loops in the source tree). We have a way to build cscope/tags files for the source tree. Is there a way to integrate cscope/tags into Eclipse? Obviously, if there are other solutions to this problem or alternative
0
8705
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
8638
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
8505
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
7196
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
6125
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
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
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.