Download File

Download File Download File

mycnis.weebly.com
from mycnis.weebly.com More from this publisher
22.07.2013 Views

} if((f=fopen(argv[1],"w"))==NULL) perror("\nUnable to open file for writing..."); else { for(i=0;msg_obj2.msg_data[i]!=0;i++) { putc(msg_obj2.msg_data[i],f); } fclose(f); //closing file } return 0; /* Compiling…………. $CC msgrecvQ.c -o msgrecvQ Execution………….. $ msgrecvQ */ NP Lab Manual , RNEC page: 16

Output: [student@localhost ~]$ cc msgrecvQ.c -o msgrecvQ [student@localhost ~]$ ./msgrecv recvpipe.c msgid=0 Rec Bytes : 415[student@localhost ~]$ cat recvpipe.c /* file name pipe.c */ # include # include # include # define MAXLINE 4096 int main() { int n,fd[2]; pid_t pid; char line[MAXLINE]; if(pipe(fd)

Output:<br />

[student@localhost ~]$ cc msgrecvQ.c -o msgrecvQ<br />

[student@localhost ~]$ ./msgrecv recvpipe.c<br />

msgid=0<br />

Rec Bytes : 415[student@localhost ~]$ cat recvpipe.c<br />

/* file name pipe.c */<br />

# include <br />

# include <br />

# include <br />

# define MAXLINE 4096<br />

int main()<br />

{<br />

int n,fd[2];<br />

pid_t pid;<br />

char line[MAXLINE];<br />

if(pipe(fd)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!