Ok some of you might have done this already but this was a recent assignment and I want to see someone beat my score!
The problem: 3 smokers each have 1 of 3 elements (rolling papers, tabacco,...
Type: Posts; User: und3rdog
Ok some of you might have done this already but this was a recent assignment and I want to see someone beat my score!
The problem: 3 smokers each have 1 of 3 elements (rolling papers, tabacco,...
stat() might help you
-luke
something like this
function(struct mystruct **a);
/*if it will not change them put a const before struct*/
not sure but that might work!
Wow, really I wish I could be as awesome a contributor as you!(I read your *nix stuff in the FAQ section) *sigh* Now come on, I'm not whining about anything other than your manners. Hammer was nice...
Real problems or problems you consider real. A real problem is reading from a pipe! esp when there is Nilch on the man pages (BTW I'm not that new)! Help or don't, but don't be an ass!
-Luke
Geez no need to get fiesty:eek: , I'm just looking at your code! There is no good reference on READ() that I've found.
-Luke
so if I try and read(stream, buffer, buffersize) from a pipe where the string in the pipe is of size 4 and the buffersize is 128? What happens, won't the read fail?
-Luke
Well yeah I had to change the write, but I did write(fd[1], inputbuffer, strlen(inputbuffer)+1) won't that give me the string plus the NULL written to the pipe? BTW where did you pick this stuff up...
NEXT question. I'm in my scheduler program, how do I get the string I just stuffed into the pipe out without knowing the size?
-Luke
Ohh that would make sense that way no matter who I stick in the exec it will have access to the pipe? for this case it doesn't matter, but thanks for the tip!
-Luke
thanks, what does dupe() do again? I thought it made an exact copy of the file descriptor? if I'm using the write(fd[1],inputbufer) i don't need it right?
So can I just move the fd[] outside of main? or will I have to pass it in order to write to the pipe? Or like could I say write(1,inputbuf);?
Thanks,
-Luke
yeah it's like saying all 3 now point to what student was pointing too!
use CODE tags
I'm trying to put a buffer to the pipe but the PARSER() can't find the fd[] array? Do I have a scope issue? Any help.. BTW my first post :D
#include <errno.h>
#include <string.h>...