UNIX/Linux Programming - April 2009

by vijkrr
How to check the client connection exist or not
 
Hi, I'm new to C socket programming. In my C code i want to check is the particular client is connected or not using the socket descriptor or in some other w...
[7 replies] Last: thanks alot sharma and kevin.. sure this will help me to solve my p... (by vijkrr)
by vijkrr
How to create our own thread class using pthread
 
Hi all, I want to create a generic thread class in UNIX using pthread.h. But pthread is accepting only "C" functions. But i want to call the C++ functions al...
[1 reply] : you can look at the implementation of boost threads or ace threads.. ... (by writetonsharma)
api to get CPU utilization
 
Hi, I am looking for api to get CPU utilization in linux. I want use that api in c++ program. anyone plz help me..
[1 reply] : Most programs (like top) just read /proc/stat which contains, on a per... (by jsmith)
How do you close an ofstream if close() fails?
 
Good morning, I ran into an interesting problem recently while coding an application that can write to tape devices, and my searches to date haven't uncovere...
[2 replies] Last: No, I haven't tested it using native calls yet. As soon as I get a ch... (by jmcdonald)
by vRltwE
Openning files
 
Hi, why this does not work? string file_name; file_name = "/home/cristiano/matrix4.dat"; ifstream iFile; iFile.open(file_name); ...
[4 replies] Last: Thanks kbw, it works! (by vRltwE)
how to get the age of a file in linux?
 
Hi, I need to compare the last modified date of a file to the current time and determine if its over x minutes old. I have been playing around but keep runn...
[7 replies] Last: Thank you PanGalactic. Ill try this as soon as I get home. Also thank ... (by retronoodle)
by vijkrr
Error in using popen
 
hi I'm using one popen function, via that i'm executing the unix commands. The Popen function is failling when it get called on 251 st time. Here is the cod...
[2 replies] Last: i fixed the issue. i didnt close the opened IO's.. (by vijkrr)
undefined reference?
 
I have the following peace of code for the producer_consumer problem: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h> #incl...
[1 reply] : This is cplusplus.com, not c.com. A C++ programmer would create a Que... (by PanGalactic)
open file from root directory
 
How do you open a file from the root directory without have to type the complete path? string path = "~/data/"; string file = path + "file.dat"; fstre...
[3 replies] Last: I know, I made a mistake. I'm sorry. My problem has solved here: ht... (by nikola17681)
by ilyes
change of directory in makefile
 
hi, i would like to execute ..... BIN=/home/usr/projet/bin all:prog mv -f $(EXEC) $(BIN) cd $(BIN) prog: ..... the command cd c...
[1 reply] : What do you want it to do once it gets there? Each command is execute... (by PanGalactic)
how to put a c++ program in the web ?
 
Dear all, I have a huge c++ program (gcc compiled) that runs on a linux console. It's an interactive program in the sense that it requires the user to enter ...
[2 replies] Last: try cgi.. you can have a html page that can invoke your c program.. (by jjose)
by vijkrr
getting time stamp in micro or milli scronds
 
hi I want to get the file creaton times in micro or milli seconds. Can any one help me in how to get it using a C++ program?
[3 replies] Last: glibc has st_ctimensec (ctime nanoseconds) as part of struct stat .... (by PanGalactic)
lost task bar
 
I accidently removed my task bar from opensuse. Anyone know how to put it back on? Thanks in advance.
[1 reply] : This is not a programming question. Go to the OpenSUSE support forum f... (by GenTiradentes)
by Syntax
C++ networking Question
 
How would i do networking with C++? I new to network programming newbie.
[6 replies] Last: It might be for a learning experience! Though I do agree to an extent.... (by closed account S6k9GNh0)
sharing variables
 
how to share an array by using shared memory..? shmget() will return a void * .but how to share an array between two processes
[9 replies] Last: *minor edit* - changed some stuff to sound less like a jerk. (sorry) ... (by writetonsharma)
How to use execl() to include linux command in a C program?
 
I tried to write a program which includes the execl function how can I do that? for example, what should I do if I want to include this command in my C progra...
[2 replies] Last: you can use 'system( )' call for ease if you use gcc. Include the ... (by Nax0r)
by vijkrr
How to run a .lex program in unix
 
Hi, I'm new to Unix, i want to run one .rex program from Unix. My program w120p.rex which is working fine in windows. I want to run the same from the Unix. I...
[1 reply] : This isn't about programming. Please read the rules / the forum topic ... (by closed account S6k9GNh0)
by sever
Encripting communications
 
Hello everybody, I'm working in a client-server GNU/Linux applications and I'd need to know which functions allow us to implement an assimetric communication...
[1 reply] : OpenSSL is the library you probably want to use for this. They've got... (by PanGalactic)
get.cin(), nested if statements and recursion troubles
 
I've dabbled in a bit of C and C++ over the years but now i want to learn more. So the best way in my opinion to really get to grips with them is to jump right ...
[3 replies] Last: Ah -- I missed the function declaration with the default value. Thank... (by PanGalactic)
simple string comparison problem
 
#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; int main () { string i; i=system("ps -A | grep firefox | awk '...
[2 replies] Last: Man, implicit int to char coersion sucks. Hint: you want popen(3), ... (by PanGalactic)
April 2009 Pages: 123
  Archived months: [mar2009] [may2009]

This is an archived page. To post a new message, go to the current page.