EmbLogic's Blog

Inter Process Communication using files:

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
this is header file
this file includes the standard libraries required in the program.
—————————-
revision 1.1 locked by: root;
date: 2015/02/27 04:43:41; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: replace1.c,v
Working file: replace1.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
this is main file
in this program we have initiated a call using execl function
—————————-
revision 1.4 locked by: root;
date: 2015/02/27 15:27:16; author: root; state: Exp; lines: +1 -1
first converting the integer to the character type
since execl takes char* as a argument.
—————————-
revision 1.3
date: 2015/02/27 15:25:30; author: root; state: Exp; lines: +2 -3
sending data to the new program initiated by execl
—————————-
revision 1.2
date: 2015/02/27 05:27:27; author: root; state: Exp; lines: +5 -5
reading back the values send by execl initiated program
output is displayed.
—————————-
revision 1.1
date: 2015/02/27 04:43:41; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: new1.c,v
Working file: new1.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
this is called by execl
—————————-
revision 1.3 locked by: root;
date: 2015/02/27 05:27:31; author: root; state: Exp; lines: +1 -1
here we have used command line arguments to collect the char* values
then these values converted to integer type using atoi()
—————————-
revision 1.2
date: 2015/02/27 04:58:29; author: root; state: Exp; lines: +1 -1
reading the values transmitted by the main program
and writting the results back to the main program.
—————————-
revision 1.1
date: 2015/02/27 04:43:41; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Tagged | Leave a comment

Sort the matrix using double pointer

RCS file: sortmat.c,v
Working file: sortmat.c
head: 1.1
branch:
locks: strict
vishal: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
Sort the matrix using double pointer
—————————-
revision 1.1 locked by: vishal;
date: 2015/02/27 20:01:49; author: vishal; state: Exp;
Initial revision

Posted in Uncategorized | Leave a comment

Read and write the data using pipe

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
vishal: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
define structer in header.h
—————————-
revision 1.1 locked by: vishal;
date: 2015/02/27 19:38:05; author: vishal; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
vishal: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
define structer in header.h
—————————-
revision 1.1 locked by: vishal;
date: 2015/02/27 19:38:05; author: vishal; state: Exp;
Initial revision
=============================================================================

RCS file: 1.c,v
Working file: 1.c
head: 1.2
branch:
locks: strict
vishal: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
Receive the file descritor and read the file form the pipe.
Use the data to perforn operation.
—————————-
revision 1.2 locked by: vishal;
date: 2015/02/27 19:48:34; author: vishal; state: Exp; lines: +1 -1
Create the pipe and save the read and write file descriptor in a array.
Fork the process and create a child.
Provide another process to child using execl.
—————————-
revision 1.1
date: 2015/02/27 19:40:18; author: vishal; state: Exp;
Initial revision
=============================================================================

RCS file: extra.c,v
Working file: extra.c
head: 1.2
branch:
locks: strict
vishal: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
forked in this program.
Then provide another process to child by using execl.
provid the the file descriptor to new by using pipe.
—————————-
revision 1.2 locked by: vishal;
date: 2015/02/27 19:47:21; author: vishal; state: Exp; lines: +1 -1
Recevie the file descriptor from the parent file .
Read the data present in the pipe and perform operation.
—————————-
revision 1.1
date: 2015/02/27 19:38:32; author: vishal; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Inter Process Communication between two files successfully done.

RCS file: fd.c,v
Working file: fd.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
Here Inter Process Communication is performed between two files.
—————————-
revision 1.1 locked by: root;
date: 2015/02/27 12:12:43; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | 2 Comments

Implemented the pipe for communicating b/w two processes for IPC

RCS file: replacing.c,v
Working file: replacing.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
opened the file
—————————-
revision 1.5 locked by: root;
date: 2015/02/26 10:54:29; author: root; state: Exp; lines: +4 -2
modification in open statement
—————————-
revision 1.4
date: 2015/02/26 10:30:24; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:40:14; author: root; state: Exp; lines: +4 -2
convert fd into char
and pass the fd by argument
—————————-
revision 1.2
date: 2015/02/26 09:11:08; author: root; state: Exp; lines: +2 -2
put \n in the end of printf()
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
—————————-
revision 1.6 locked by: root;
date: 2015/02/26 10:54:51; author: root; state: Exp; lines: +1 -1
print fd
—————————-
revision 1.5
date: 2015/02/26 10:30:26; author: root; state: Exp; lines: +4 -3
*** empty log message ***
—————————-
revision 1.4
date: 2015/02/26 09:45:17; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:43:11; author: root; state: Exp; lines: +1 -1
declare buff
—————————-
revision 1.2
date: 2015/02/26 09:41:10; author: root; state: Exp; lines: +5 -0
covert the fd into int
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
include stdio.h, stdlib.h, fcntl.h &unistd.h
—————————-
revision 1.1 locked by: root;
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: replacing.c,v
Working file: replacing.c
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10; selected revisions: 10
description:
opened the file
—————————-
revision 1.10 locked by: root;
date: 2015/02/27 11:18:42; author: root; state: Exp; lines: +4 -2
convert rfd, wfd into char using sprintf
—————————-
revision 1.9
date: 2015/02/27 10:32:37; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.8
date: 2015/02/27 10:23:11; author: root; state: Exp; lines: +4 -2
gave command line arguments in execl()
—————————-
revision 1.7
date: 2015/02/27 10:08:16; author: root; state: Exp; lines: +12 -1
make pipe
try to write into another file using pipe
—————————-
revision 1.6
date: 2015/02/26 11:35:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2015/02/26 10:54:29; author: root; state: Exp; lines: +4 -2
modification in open statement
—————————-
revision 1.4
date: 2015/02/26 10:30:24; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:40:14; author: root; state: Exp; lines: +4 -2
convert fd into char
and pass the fd by argument
—————————-
revision 1.2
date: 2015/02/26 09:11:08; author: root; state: Exp; lines: +2 -2
put \n in the end of printf()
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10; selected revisions: 10
description:
—————————-
revision 1.10 locked by: root;
date: 2015/02/27 11:29:15; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.9
date: 2015/02/27 11:19:16; author: root; state: Exp; lines: +5 -3
*** empty log message ***
—————————-
revision 1.8
date: 2015/02/27 10:23:49; author: root; state: Exp; lines: +9 -1
*** empty log message ***
—————————-
revision 1.7
date: 2015/02/27 10:09:03; author: root; state: Exp; lines: +6 -1
try to read
—————————-
revision 1.6
date: 2015/02/26 10:54:51; author: root; state: Exp; lines: +1 -1
print fd
—————————-
revision 1.5
date: 2015/02/26 10:30:26; author: root; state: Exp; lines: +4 -3
*** empty log message ***
—————————-
revision 1.4
date: 2015/02/26 09:45:17; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:43:11; author: root; state: Exp; lines: +1 -1
declare buff
—————————-
revision 1.2
date: 2015/02/26 09:41:10; author: root; state: Exp; lines: +5 -0
covert the fd into int
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
include stdio.h, stdlib.h, fcntl.h &unistd.h
—————————-
revision 1.2 locked by: root;
date: 2015/02/27 10:07:48; author: root; state: Exp; lines: +6 -0
gave the defination of message struture
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Inter process communication using pipe successfully done.

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
This is header file
include stdio.h stdlib.h sys/types.h unistd.h
—————————-
revision 1.2 locked by: root;
date: 2015/02/27 10:26:23; author: root; state: Exp; lines: +5 -1
define struct message
—————————-
revision 1.1
date: 2015/02/27 09:26:47; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: adder.c,v
Working file: adder.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
this is adder.c file
execl will run this process
—————————-
revision 1.4 locked by: root;
date: 2015/02/27 10:53:04; author: root; state: Exp; lines: +12 -5
write sum into pipe through wfd
—————————-
revision 1.3
date: 2015/02/27 10:27:33; author: root; state: Exp; lines: +5 -0
read struct message m through rfd.
print each element of m
—————————-
revision 1.2
date: 2015/02/27 09:55:22; author: root; state: Exp; lines: +4 -2
pass rfd to execl
—————————-
revision 1.1
date: 2015/02/27 09:46:47; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.c
head: 1.8
branch:
locks: strict
root: 1.8
access list:
symbolic names:
keyword substitution: kv
total revisions: 8; selected revisions: 8
description:
This is main.c
child process is created using fork
—————————-
revision 1.8 locked by: root;
date: 2015/02/27 10:54:13; author: root; state: Exp; lines: +2 -0
close rfd and wfd
—————————-
revision 1.7
date: 2015/02/27 10:52:25; author: root; state: Exp; lines: +6 -4
read pipe through rfd
—————————-
revision 1.6
date: 2015/02/27 10:26:56; author: root; state: Exp; lines: +9 -2
write struct message m to wfd
—————————-
revision 1.5
date: 2015/02/27 09:55:15; author: root; state: Exp; lines: +3 -1
print rfd
—————————-
revision 1.4
date: 2015/02/27 09:46:33; author: root; state: Exp; lines: +1 -1
print hello.
—————————-
revision 1.3
date: 2015/02/27 09:30:46; author: root; state: Exp; lines: +4 -3
print the rfd and wfd
—————————-
revision 1.2
date: 2015/02/27 09:27:38; author: root; state: Exp; lines: +2 -1
create a pipe
print rfd and wfd
—————————-
revision 1.1
date: 2015/02/27 09:22:38; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Linux Internals and System Programming | Leave a comment

Program that reads until 0 is entered & reports even , odd integers & their averages.

#include
2 int main()
3 {
4 int num=0,evn=0,odd=0,even_sum=0,odd_sum=0;
5
6
7 for(;;)
8 {
9 printf(“enter the numbers\n”);
10 scanf(“%d”, &num);
11
12 if(num==0)
13 {
14 break;
15 }
16
17 else if(num%2==0)
18 {
19 evn++;
20 even_sum+= num;
21 }
22
23 else if(num%2!=0)
{
25 odd++;
26 odd_sum+=num;
27 }
28 }
29
30 printf(“the total no. of even numbers is %d\n”, evn);
31 printf(“the total no. of odd numbers is %d\n”, odd);
32 printf(“\neven Sum:%d”,even_sum);
33 printf(“\nodd sum:%d\n”,odd_sum);
34 printf(“the average of evn numbers is %d\n”,(int)(even_sum/evn));
35 printf(“the average of odd numbers is %d\n”, (int)(odd_sum/odd));
36
37 return 0;
38 }
39 p

1,4 Top

Posted in Uncategorized | Leave a comment

Program representing zombie state

RCS file: zoombie.c,v
Working file: zoombie.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
Program describes zombie state where the child process waits for parent process for its termination section.
—————————-
revision 1.1    locked by: root;
date: 2015/02/27 06:47:33;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Program representing Zombie state

RCS file: zombie.c,v
Working file: zombie.c
head: 1.1
branch:
locks: strict
	root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
Program describes the zombie state where the child process waits for the parent process for its termination section.
----------------------------
revision 1.1	locked by: root;
date: 2015/02/27 06:46:59;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

inter process communication using file successfully done.

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
Header file
—————————-
revision 1.2 locked by: root;
date: 2015/02/26 14:25:18; author: root; state: Exp; lines: +2 -2
include

—————————-
revision 1.1
date: 2015/02/26 14:24:00; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: replace.c,v
Working file: replace.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
replace file
—————————-
revision 1.5 locked by: root;
date: 2015/02/26 14:50:03; author: root; state: Exp; lines: +1 -1
read from file
print file content
—————————-
revision 1.4
date: 2015/02/26 14:45:12; author: root; state: Exp; lines: +18 -18
open a file
pas file discriptor to execl() process
—————————-
revision 1.3
date: 2015/02/26 14:35:06; author: root; state: Exp; lines: +1 -1
new process is created in child using execl()
—————————-
revision 1.2
date: 2015/02/26 14:30:28; author: root; state: Exp; lines: +19 -19
new process is created using fork()
—————————-
revision 1.1
date: 2015/02/26 14:24:00; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
new process file
—————————-
revision 1.3 locked by: root;
date: 2015/02/26 14:47:43; author: root; state: Exp; lines: +13 -13
lseek file discriptor
read file
write into file
—————————-
revision 1.2
date: 2015/02/26 14:45:50; author: root; state: Exp; lines: +13 -13
print hello
—————————-
revision 1.1
date: 2015/02/26 14:24:00; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Linux Internals and System Programming | Leave a comment

replacing the file

RCS file: replace.c,v
Working file: replace.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
include all the header file which are required
then take a file descriptor and a char type varible name as arry buff
then give the open command for a file
print the fd which is return by open commnd
—————————-
revision 1.4 locked by: root;
date: 2015/02/26 14:54:00; author: root; state: Exp; lines: +3 -3
here print the parent is active
the after the child is active
after that use the execl command for replacing the other file
and terminate the program
—————————-
revision 1.3
date: 2015/02/26 14:52:26; author: root; state: Exp; lines: +3 -2
put the switch case statement
—————————-
revision 1.2
date: 2015/02/26 14:47:51; author: root; state: Exp; lines: +2 -2
here we capture the fork into a varible
—————————-
revision 1.1
date: 2015/02/26 14:41:44; author: root; state: Exp;
Initial revision

Posted in Uncategorized | Leave a comment

implementing fork() and execl() with atoi() command to writting on file to another

RCS file: replacing.c,v
Working file: replacing.c
head: 1.1
branch:
locks: strict
emblogic: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
using pid_t command with fork
—————————-
revision 1.1    locked by: emblogic;
date: 2015/02/26 09:54:59;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: replacing.c,v
Working file: replacing.c
head: 1.1
branch:
locks: strict
emblogic: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
using pid_t command with fork
—————————-
revision 1.1    locked by: emblogic;
date: 2015/02/26 09:54:59;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
print the statement hello friends.
,
—————————-
revision 1.2
date: 2015/02/26 11:33:08;  author: root;  state: Exp;  lines: +4 -0
using atoi command
—————————-
revision 1.1
date: 2015/02/26 09:54:59;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.c,v
Working file: header.c
head:
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 0
description:
use unistd.h
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

implimented the fork() & execl() for writing into a file from another file.

RCS file: replacing.c,v
Working file: replacing.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
opened the file
—————————-
revision 1.5 locked by: root;
date: 2015/02/26 10:54:29; author: root; state: Exp; lines: +4 -2
modification in open statement
—————————-
revision 1.4
date: 2015/02/26 10:30:24; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:40:14; author: root; state: Exp; lines: +4 -2
convert fd into char
and pass the fd by argument
—————————-
revision 1.2
date: 2015/02/26 09:11:08; author: root; state: Exp; lines: +2 -2
put \n in the end of printf()
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: hello.c,v
Working file: hello.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
—————————-
revision 1.6 locked by: root;
date: 2015/02/26 10:54:51; author: root; state: Exp; lines: +1 -1
print fd
—————————-
revision 1.5
date: 2015/02/26 10:30:26; author: root; state: Exp; lines: +4 -3
*** empty log message ***
—————————-
revision 1.4
date: 2015/02/26 09:45:17; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.3
date: 2015/02/26 09:43:11; author: root; state: Exp; lines: +1 -1
declare buff
—————————-
revision 1.2
date: 2015/02/26 09:41:10; author: root; state: Exp; lines: +5 -0
covert the fd into int
—————————-
revision 1.1
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
include stdio.h, stdlib.h, fcntl.h &unistd.h
—————————-
revision 1.1 locked by: root;
date: 2015/02/26 09:06:38; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Implementation of execl() and fork() for writing into textfile from the child process

RCS file: replacing.c,v
Working file: replacing.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
i this we have used fork().
—————————-
revision 1.3    locked by: root;
date: 2015/02/26 10:37:03;  author: root;  state: Exp;  lines: +8 -3
now ew have passed fd by execl()
fd was of type int and is converted to char by sprintf to make it compatible with execl()
—————————-
revision 1.2
date: 2015/02/26 09:30:29;  author: root;  state: Exp;  lines: +12 -2
opening a textfile.
invoking execl() inside child process.
—————————-
revision 1.1
date: 2015/02/26 09:05:24;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
just given printf statement for printing the statement
—————————-
revision 1.2    locked by: root;
date: 2015/02/26 10:39:35;  author: root;  state: Exp;  lines: +11 -1
Firstly fd is convert back to int using atoi
then we are writting a string into textfile .
—————————-
revision 1.1
date: 2015/02/26 09:38:30;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
included stdio.h,unistd.h,stdlib.h.
—————————-
revision 1.2
date: 2015/02/26 09:33:12;  author: root;  state: Exp;  lines: +1 -1
included fcntl.h
—————————-
revision 1.1
date: 2015/02/26 09:07:30;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Implementation of execl() and fork() for writing into textfile from the child process

RCS file: replacing.c,v
Working file: replacing.c
head: 1.3
branch:
locks: strict
	root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
In this program we have used fork()
----------------------------
revision 1.3	locked by: root;
date: 2015/02/26 10:36:34;  author: root;  state: Exp;  lines: +2 -2
nw we have passed the fd by using execl()
fd was of integer type bt execl() accepts character string so thats why we have converted int to char type by using sprintf command
----------------------------
revision 1.2
date: 2015/02/26 09:30:31;  author: root;  state: Exp;  lines: +14 -1
opening the a textfile
invoking execl inside the child process
----------------------------
revision 1.1
date: 2015/02/26 09:05:11;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
	root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
included the various header files that have beent are used in the program
----------------------------
revision 1.2	locked by: root;
date: 2015/02/26 09:33:05;  author: root;  state: Exp;  lines: +1 -0
just included a header file i.e fcntl.h for opening the file
----------------------------
revision 1.1
date: 2015/02/26 09:07:47;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: new.c,v
Working file: new.c
head: 1.2
branch:
locks: strict
	root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
just given a printf statement for printing the statement.
----------------------------
revision 1.2	locked by: root;
date: 2015/02/26 10:39:29;  author: root;  state: Exp;  lines: +8 -2
firstly we have converted back to int using atoi 
then we are writing the string into the textfile
----------------------------
revision 1.1
date: 2015/02/26 09:35:46;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment