That did the trick, thanks a bunch. I'll chalk that up to my C inexperience, I wasn't even aware you could do that.
Type: Posts; User: crazeinc
That did the trick, thanks a bunch. I'll chalk that up to my C inexperience, I wasn't even aware you could do that.
I'm working on a 1-to-many consumer/producers problem. The trouble is when I execute more than one producer to connect to the consumer, the other producer that was already connected isn't finishing...
The code is pretty sloppy, but I'm trying to figure out socket programming in unix and have a problem. The client passes a filename to a "fileserver", fileserver returns a code if the file is there...
If I comment out this code in testgenerate.c
/* read from pipe */
while(check = read(fd,readbuf,10) != 0){
if(check == -1)
{
perror("Read error\n");
return 5;
}
The jist of this program is there's testgenerate that reads from a pipe called ncc, after it forks two children that both write to the pipe. The only problem is that when the processes open the pipe,...
when the recursion is on it's way back up, it appears that the while((dirt = readdir(dirp)) != NULL) condition is failing even though that isn't the case. The /root/code folder also has a hw2/ folder...
Yea, i noticed that, I've updated my code so it won't do that anymore.
figured it out :)
thanks for the help.
I'm trying my hand with a little unix programming, but my second execvp in main() below doesn't appear to be working correctly.
A sample call to this would be ./rungenerator 20 1 and the output is...